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 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); } } gc.restore(); }
void ChunkedUpdateDrawingAreaProxy::update(UpdateChunk* updateChunk) { drawUpdateChunkIntoBackingStore(updateChunk); WebPageProxy* page = this->page(); page->process()->connection()->send(DrawingAreaMessage::DidUpdate, page->pageID(), CoreIPC::In()); }
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)); }
void UIGamepadProvider::viewBecameActive(WebPageProxy& page) { if (!m_processPoolsUsingGamepads.contains(&page.process().processPool())) return; if (!m_isMonitoringGamepads) startMonitoringGamepads(); if (platformWebPageProxyForGamepadInput()) platformStartMonitoringInput(); }
void TiledDrawingAreaProxy::removeTile(const TiledDrawingAreaTile::Coordinate& coordinate) { RefPtr<TiledDrawingAreaTile> tile = m_tiles.take(coordinate); m_tilesByID.remove(tile->ID()); if (!tile->hasBackBufferUpdatePending()) return; WebPageProxy* page = this->page(); page->process()->send(DrawingAreaLegacyMessage::CancelTileUpdate, page->pageID(), CoreIPC::In(tile->ID())); }
void TiledDrawingAreaProxy::didSetSize(const IntSize& viewSize) { ASSERT(m_isWaitingForDidSetFrameNotification); m_isWaitingForDidSetFrameNotification = false; if (viewSize != m_lastSetViewSize) setSize(m_lastSetViewSize); WebPageProxy* page = this->page(); page->process()->responsivenessTimer()->stop(); }
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. }
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); }
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())); }
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(); }
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)); }
void LayerBackedDrawingAreaProxy::update() { WebPageProxy* page = this->page(); page->process()->send(DrawingAreaLegacyMessage::DidUpdate, page->pageID(), CoreIPC::In(info().identifier)); }
void TiledDrawingAreaProxy::takeSnapshot(const IntSize& size, const IntRect& contentsRect) { WebPageProxy* page = this->page(); page->process()->send(DrawingAreaLegacyMessage::TakeSnapshot, page->pageID(), CoreIPC::Out(size, contentsRect)); }