Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: third_party/WebKit/Source/web/ChromeClientImpl.cpp

Issue 2342103002: Refactor the way PaintArtifactCompositor is attached and used. (Closed)
Patch Set: none Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/ChromeClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
index f081d46663df622becb2c4881350200450e9306e..4d24be35443228d0754cdf97dce901129f26620c 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -795,6 +795,7 @@ String ChromeClientImpl::acceptLanguages()
void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFrame* localFrame)
{
+ DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->localRoot();
// This method can be called while the frame is being detached. In that
@@ -804,11 +805,15 @@ void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFr
webFrame->frameWidget()->setRootGraphicsLayer(rootLayer);
}
-void ChromeClientImpl::didPaint(const PaintArtifact& paintArtifact)
+void ChromeClientImpl::attachRootLayer(WebLayer* rootLayer, LocalFrame* localFrame)
{
- // TODO(jbroman): This doesn't handle OOPIF correctly. We probably need a
- // branch for WebFrameWidget, like attachRootGraphicsLayer.
- m_webView->getPaintArtifactCompositor().update(paintArtifact);
+ WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->localRoot();
+
+ // This method can be called while the frame is being detached. In that
+ // case, the rootLayer is null, and the widget is already destroyed.
+ DCHECK(webFrame->frameWidget() || !rootLayer);
+ if (webFrame->frameWidget())
+ webFrame->frameWidget()->setRootLayer(rootLayer);
}
void ChromeClientImpl::attachCompositorAnimationTimeline(CompositorAnimationTimeline* compositorTimeline, LocalFrame* localFrame)
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.h ('k') | third_party/WebKit/Source/web/WebFrameWidgetBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698