void WebsiteDataStore::cloneSessionData(WebPageProxy& sourcePage, WebPageProxy& newPage) { auto& sourceDataStore = sourcePage.websiteDataStore(); auto& newDataStore = newPage.websiteDataStore(); // FIXME: Handle this. if (&sourceDataStore != &newDataStore) return; if (!sourceDataStore.m_storageManager) return; sourceDataStore.m_storageManager->cloneSessionStorageNamespace(sourcePage.pageID(), newPage.pageID()); }
void ChunkedUpdateDrawingAreaProxy::paint(const IntRect& rect, PlatformDrawingContext context) { if (m_isWaitingForDidSetFrameNotification) { WebPageProxy* page = this->page(); if (!page->isValid()) return; std::auto_ptr<CoreIPC::ArgumentDecoder> arguments = page->process()->connection()->waitFor(DrawingAreaProxyMessage::DidSetSize, page->pageID(), 0.04); if (arguments.get()) didReceiveMessage(page->process()->connection(), CoreIPC::MessageID(DrawingAreaProxyMessage::DidSetSize), *arguments.get()); } platformPaint(rect, context); }
void WebNotificationManagerProxy::providerDidClickNotification(uint64_t globalNotificationID) { auto it = m_globalNotificationMap.find(globalNotificationID); if (it == m_globalNotificationMap.end()) return; uint64_t webPageID = it->value.first; WebPageProxy* webPage = WebProcessProxy::webPage(webPageID); if (!webPage) return; uint64_t pageNotificationID = it->value.second; webPage->process().send(Messages::WebNotificationManager::DidClickNotification(pageNotificationID), 0); }
void WebNotificationManagerProxy::providerDidShowNotification(uint64_t globalNotificationID) { HashMap<uint64_t, pair<uint64_t, uint64_t> >::iterator it = m_globalNotificationMap.find(globalNotificationID); if (it == m_globalNotificationMap.end()) return; uint64_t webPageID = it->value.first; WebPageProxy* webPage = WebProcessProxy::webPage(webPageID); if (!webPage) return; uint64_t pageNotificationID = it->value.second; webPage->process()->send(Messages::WebNotificationManager::DidShowNotification(pageNotificationID), 0); }
Eina_Bool ewk_view_intent_deliver(Evas_Object* ewkView, Ewk_Intent* intent) { #if ENABLE(WEB_INTENTS) EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false); EwkIntent* intentImpl = ewk_object_cast<EwkIntent*>(intent); EINA_SAFETY_ON_NULL_RETURN_VAL(intentImpl, false); WebPageProxy* page = impl->page(); page->deliverIntentToFrame(page->mainFrame(), intentImpl->webIntentData()); return true; #else return false; #endif }
void ChunkedUpdateDrawingAreaProxy::update(UpdateChunk* updateChunk) { if (!m_isVisible) { // We got an update request that must have been sent before we told the web process to suspend painting. // Don't paint this into the backing store, because that could leave the backing store in an inconsistent state. // Instead, we will just tell the drawing area to repaint everything when we resume painting. m_forceRepaintWhenResumingPainting = true; } else { // Just paint into backing store. drawUpdateChunkIntoBackingStore(updateChunk); } WebPageProxy* page = this->page(); page->process()->send(DrawingAreaMessage::DidUpdate, page->pageID(), CoreIPC::In(id())); }
WebColorPickerGtk::WebColorPickerGtk(WebPageProxy& page, const Color& initialColor, const IntRect&) : WebColorPicker(&page) , m_initialColor(initialColor) , m_webView(page.viewWidget()) , m_colorChooser(nullptr) { }
void ChunkedUpdateDrawingAreaProxy::didSetSize(UpdateChunk* updateChunk) { ASSERT(m_isWaitingForDidSetFrameNotification); m_isWaitingForDidSetFrameNotification = false; IntSize viewSize = updateChunk->rect().size(); if (viewSize != m_lastSetViewSize) setSize(m_lastSetViewSize); invalidateBackingStore(); drawUpdateChunkIntoBackingStore(updateChunk); WebPageProxy* page = this->page(); page->process()->responsivenessTimer()->stop(); }
static void drawPagesForPrintingCompleted(API::Error* wkPrintError, WebKitPrintOperation* printOperation) { // When running synchronously WebPageProxy::printFrame() calls endPrinting(). if (printOperation->priv->printMode == PrintInfo::PrintModeAsync && printOperation->priv->webView) { WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(printOperation->priv->webView)); page->endPrinting(); } const WebCore::ResourceError& resourceError = wkPrintError ? wkPrintError->platformError() : WebCore::ResourceError(); if (!resourceError.isNull()) { GUniquePtr<GError> printError(g_error_new_literal(g_quark_from_string(resourceError.domain().utf8().data()), toWebKitError(resourceError.errorCode()), resourceError.localizedDescription().utf8().data())); g_signal_emit(printOperation, signals[FAILED], 0, printError.get()); } g_signal_emit(printOperation, signals[FINISHED], 0, NULL); }
// Called by WebInspectorProxy messages void WebInspectorProxy::createInspectorPage(uint64_t& inspectorPageID, WebPageCreationParameters& inspectorPageParameters) { inspectorPageID = 0; if (!m_page) return; WebPageProxy* inspectorPage = platformCreateInspectorPage(); ASSERT(inspectorPage); if (!inspectorPage) return; inspectorPageID = inspectorPage->pageID(); inspectorPageParameters = inspectorPage->creationParameters(IntSize(0, 0)); inspectorPage->loadURL(inspectorPageURL()); }
GestureController::ZoomGesture::ZoomGesture(WebPageProxy& page) : Gesture(gtk_gesture_zoom_new(page.viewWidget()), page) , m_initialScale(0) , m_scale(0) { g_signal_connect_swapped(m_gesture.get(), "begin", G_CALLBACK(begin), this); g_signal_connect_swapped(m_gesture.get(), "scale-changed", G_CALLBACK(scaleChanged), this); }
std::unique_ptr<RedirectedXCompositeWindow> RedirectedXCompositeWindow::create(WebPageProxy& webPage, const IntSize& initialSize, std::function<void()>&& damageNotify) { GdkWindow* parentWindow = gtk_widget_get_parent_window(webPage.viewWidget()); ASSERT(GDK_IS_WINDOW(parentWindow)); if (!supportsXDamageAndXComposite(parentWindow)) return nullptr; return std::unique_ptr<RedirectedXCompositeWindow>(new RedirectedXCompositeWindow(webPage, initialSize, WTFMove(damageNotify))); }
void WebProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) { if (messageID.is<CoreIPC::MessageClassWebProcessProxy>()) { didReceiveWebProcessProxyMessage(connection, messageID, arguments); return; } if (messageID.is<CoreIPC::MessageClassWebContext>() || messageID.is<CoreIPC::MessageClassWebContextLegacy>() || messageID.is<CoreIPC::MessageClassDownloadProxy>() || messageID.is<CoreIPC::MessageClassWebApplicationCacheManagerProxy>() #if ENABLE(BATTERY_STATUS) || messageID.is<CoreIPC::MessageClassWebBatteryManagerProxy>() #endif || messageID.is<CoreIPC::MessageClassWebCookieManagerProxy>() || messageID.is<CoreIPC::MessageClassWebDatabaseManagerProxy>() || messageID.is<CoreIPC::MessageClassWebGeolocationManagerProxy>() || messageID.is<CoreIPC::MessageClassWebIconDatabase>() || messageID.is<CoreIPC::MessageClassWebKeyValueStorageManagerProxy>() || messageID.is<CoreIPC::MessageClassWebMediaCacheManagerProxy>() #if ENABLE(NETWORK_INFO) || messageID.is<CoreIPC::MessageClassWebNetworkInfoManagerProxy>() #endif || messageID.is<CoreIPC::MessageClassWebNotificationManagerProxy>() #if USE(SOUP) || messageID.is<CoreIPC::MessageClassWebSoupRequestManagerProxy>() #endif #if ENABLE(VIBRATION) || messageID.is<CoreIPC::MessageClassWebVibrationProxy>() #endif || messageID.is<CoreIPC::MessageClassWebResourceCacheManagerProxy>()) { m_context->didReceiveMessage(this, messageID, arguments); return; } uint64_t pageID = arguments->destinationID(); if (!pageID) return; WebPageProxy* pageProxy = webPage(pageID); if (!pageProxy) return; pageProxy->didReceiveMessage(connection, messageID, arguments); }
GestureController::DragGesture::DragGesture(WebPageProxy& page) : Gesture(gtk_gesture_drag_new(page.viewWidget()), page) , m_inDrag(false) { gtk_gesture_single_set_touch_only(GTK_GESTURE_SINGLE(m_gesture.get()), TRUE); g_signal_connect_swapped(m_gesture.get(), "drag-begin", G_CALLBACK(begin), this); g_signal_connect_swapped(m_gesture.get(), "drag-update", G_CALLBACK(update), this); g_signal_connect_swapped(m_gesture.get(), "end", G_CALLBACK(end), this); }
void ChunkedUpdateDrawingAreaProxy::setSize(const IntSize& viewSize) { WebPageProxy* page = this->page(); if (!page->isValid()) return; if (viewSize.isEmpty()) return; m_viewSize = viewSize; m_lastSetViewSize = viewSize; if (m_isWaitingForDidSetFrameNotification) return; m_isWaitingForDidSetFrameNotification = true; page->process()->responsivenessTimer()->start(); page->process()->send(DrawingAreaMessage::SetSize, page->pageID(), CoreIPC::In(id(), viewSize)); }
void TiledDrawingAreaProxy::sizeDidChange() { WebPageProxy* page = this->page(); if (!page || !page->isValid()) return; if (m_size.isEmpty()) return; m_viewSize = m_size; m_lastSetViewSize = m_size; if (m_isWaitingForDidSetFrameNotification) return; m_isWaitingForDidSetFrameNotification = true; page->process()->responsivenessTimer()->start(); page->process()->send(DrawingAreaLegacyMessage::SetSize, page->pageID(), CoreIPC::In(m_size)); }
DrawingAreaProxy::DrawingAreaProxy(DrawingAreaType type, WebPageProxy& webPageProxy) : m_type(type) , m_webPageProxy(webPageProxy) , m_size(webPageProxy.viewSize()) #if PLATFORM(MAC) , m_exposedRectChangedTimer(RunLoop::main(), this, &DrawingAreaProxy::exposedRectChangedTimerFired) #endif { m_webPageProxy.process().addMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), m_webPageProxy.pageID(), *this); }
void TiledDrawingAreaProxy::paint(const IntRect& rect, PlatformDrawingContext context) { if (m_isWaitingForDidSetFrameNotification) { WebPageProxy* page = this->page(); if (!page->isValid()) return; if (page->process()->isLaunching()) return; } adjustVisibleRect(); GraphicsContext gc(context); gc.save(); // Assumes the backing store is painted with the scale transform applied. // Since tile content is already scaled, first revert the scaling from the painter. gc.scale(FloatSize(1 / m_contentsScale, 1 / m_contentsScale)); IntRect dirtyRect = mapFromContents(rect); TiledDrawingAreaTile::Coordinate topLeft = tileCoordinateForPoint(dirtyRect.topLeft()); TiledDrawingAreaTile::Coordinate bottomRight = tileCoordinateForPoint(dirtyRect.bottomRight()); for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) { for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) { TiledDrawingAreaTile::Coordinate currentCoordinate(xCoordinate, yCoordinate); RefPtr<TiledDrawingAreaTile> currentTile = tileAt(currentCoordinate); if (currentTile && currentTile->isReadyToPaint()) currentTile->paint(&gc, dirtyRect); else { IntRect tileRect = tileRectForCoordinate(currentCoordinate); IntRect target = intersection(tileRect, dirtyRect); if (target.isEmpty()) continue; TiledDrawingAreaTile::paintCheckerPattern(&gc, FloatRect(target)); } } } gc.restore(); }
void WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply) { if (m_context->dispatchSyncMessage(connection, messageID, arguments, reply)) return; if (messageID.is<CoreIPC::MessageClassWebProcessProxy>()) { didReceiveSyncWebProcessProxyMessage(connection, messageID, arguments, reply); return; } uint64_t pageID = arguments->destinationID(); if (!pageID) return; WebPageProxy* pageProxy = webPage(pageID); if (!pageProxy) return; pageProxy->didReceiveSyncMessage(connection, messageID, arguments, reply); }
ViewGestureController::ViewGestureController(WebPageProxy& webPageProxy) : m_webPageProxy(webPageProxy) , m_swipeActiveLoadMonitoringTimer(RunLoop::main(), this, &ViewGestureController::checkForActiveLoads) #if PLATFORM(MAC) , m_pendingSwipeTracker(webPageProxy, std::bind(&ViewGestureController::trackSwipeGesture, this, std::placeholders::_1, std::placeholders::_2)) #endif { m_webPageProxy.process().addMessageReceiver(Messages::ViewGestureController::messageReceiverName(), m_webPageProxy.pageID(), *this); viewGestureControllersForAllPages().add(webPageProxy.pageID(), this); }
void UIGamepadProvider::viewBecameActive(WebPageProxy& page) { if (!m_processPoolsUsingGamepads.contains(&page.process().processPool())) return; if (!m_isMonitoringGamepads) startMonitoringGamepads(); if (platformWebPageProxyForGamepadInput()) platformStartMonitoringInput(); }
void LayerBackedDrawingAreaProxy::sizeDidChange() { WebPageProxy* page = this->page(); if (!page->isValid()) return; if (m_size.isEmpty()) return; m_lastSetViewSize = m_size; platformSetSize(); if (m_isWaitingForDidSetFrameNotification) return; m_isWaitingForDidSetFrameNotification = true; page->process()->send(DrawingAreaLegacyMessage::SetSize, page->pageID(), CoreIPC::In(info().identifier, m_size)); }
// Called by WebInspectorProxy messages void WebInspectorProxy::createInspectorPage(uint64_t& inspectorPageID, WebPageCreationParameters& inspectorPageParameters) { inspectorPageID = 0; if (!m_page) return; m_isAttached = shouldOpenAttached(); WebPageProxy* inspectorPage = platformCreateInspectorPage(); ASSERT(inspectorPage); if (!inspectorPage) return; inspectorPageID = inspectorPage->pageID(); inspectorPageParameters = inspectorPage->creationParameters(); String url = inspectorPageURL(); if (m_isAttached) url += "?docked=true"; m_page->process()->assumeReadAccessToBaseURL(inspectorBaseURL()); inspectorPage->loadURL(url); }
void WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder) { if (m_messageReceiverMap.dispatchSyncMessage(connection, messageID, decoder, replyEncoder)) return; if (m_context->dispatchSyncMessage(connection, messageID, decoder, replyEncoder)) return; if (messageID.is<CoreIPC::MessageClassWebProcessProxy>()) { didReceiveSyncWebProcessProxyMessage(connection, messageID, decoder, replyEncoder); return; } uint64_t pageID = decoder.destinationID(); if (!pageID) return; WebPageProxy* pageProxy = webPage(pageID); if (!pageProxy) return; pageProxy->didReceiveSyncMessage(connection, messageID, decoder, replyEncoder); }
void ChunkedUpdateDrawingAreaProxy::setPageIsVisible(bool isVisible) { WebPageProxy* page = this->page(); if (isVisible == m_isVisible) return; m_isVisible = isVisible; if (!page->isValid()) return; if (!m_isVisible) { // Tell the web process that it doesn't need to paint anything for now. page->process()->send(DrawingAreaMessage::SuspendPainting, page->pageID(), CoreIPC::In(id())); return; } // The page is now visible, resume painting. page->process()->send(DrawingAreaMessage::ResumePainting, page->pageID(), CoreIPC::In(id(), m_forceRepaintWhenResumingPainting)); m_forceRepaintWhenResumingPainting = false; }
void LayerBackedDrawingAreaProxy::setPageIsVisible(bool isVisible) { WebPageProxy* page = this->page(); if (isVisible == m_isVisible) return; m_isVisible = isVisible; if (!page->isValid()) return; if (!m_isVisible) { // Tell the web process that it doesn't need to paint anything for now. page->process()->send(DrawingAreaLegacyMessage::SuspendPainting, page->pageID(), CoreIPC::In(info().identifier)); return; } // The page is now visible. page->process()->send(DrawingAreaLegacyMessage::ResumePainting, page->pageID(), CoreIPC::In(info().identifier)); // FIXME: We should request a full repaint here if needed. }
bool WebInspectorProxy::isInspectorPage(WebPageProxy& page) { return WebInspectorPageGroups::shared().isInspectorPageGroup(page.pageGroup()); }
void LayerBackedDrawingAreaProxy::update() { WebPageProxy* page = this->page(); page->process()->send(DrawingAreaLegacyMessage::DidUpdate, page->pageID(), CoreIPC::In(info().identifier)); }
void WebsiteDataStore::webPageWillOpenConnection(WebPageProxy& webPageProxy, IPC::Connection& connection) { if (m_storageManager) m_storageManager->setAllowedSessionStorageNamespaceConnection(webPageProxy.pageID(), &connection); }
void WebsiteDataStore::webPageDidCloseConnection(WebPageProxy& webPageProxy, IPC::Connection&) { if (m_storageManager) m_storageManager->setAllowedSessionStorageNamespaceConnection(webPageProxy.pageID(), nullptr); }