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

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

Issue 2036403002: Always use the WebFrameWidget when attaching the root graphics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix SwapMainFrame test Created 4 years, 6 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 6b3b603d7c53018d4218d65de9207089a6ba5ad0..9ed709306faea81f1192a168a7ce36e1d11fd132 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -788,24 +788,12 @@ String ChromeClientImpl::acceptLanguages()
return m_webView->client()->acceptLanguages();
}
-void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFrame* localRoot)
+void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFrame* localFrame)
{
- // FIXME: For top-level frames we still use the WebView as a WebWidget. This
- // special case will be removed when top-level frames get WebFrameWidgets.
- if (localRoot->isMainFrame()) {
- m_webView->setRootGraphicsLayer(rootLayer);
- } else {
- WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot);
- // FIXME: The following conditional is only needed for staging until the
- // Chromium patch lands that instantiates a WebFrameWidget.
- if (!webFrame->frameWidget()) {
- m_webView->setRootGraphicsLayer(rootLayer);
- return;
- }
- DCHECK(webFrame);
- DCHECK(webFrame->frameWidget());
- toWebFrameWidgetImpl(webFrame->frameWidget())->setRootGraphicsLayer(rootLayer);
- }
+ WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->localRoot();
+ DCHECK(webFrame->frameWidget() || !rootLayer);
+ if (webFrame->frameWidget())
dcheng 2016/07/04 07:34:36 Please add a comment why this method and the metho
lfg 2016/07/04 17:46:12 Done.
+ webFrame->frameWidget()->setRootGraphicsLayer(rootLayer);
}
void ChromeClientImpl::didPaint(const PaintArtifact& paintArtifact)
@@ -815,44 +803,17 @@ void ChromeClientImpl::didPaint(const PaintArtifact& paintArtifact)
m_webView->getPaintArtifactCompositor().update(paintArtifact);
}
-void ChromeClientImpl::attachCompositorAnimationTimeline(CompositorAnimationTimeline* compositorTimeline, LocalFrame* localRoot)
+void ChromeClientImpl::attachCompositorAnimationTimeline(CompositorAnimationTimeline* compositorTimeline, LocalFrame* localFrame)
{
- // FIXME: For top-level frames we still use the WebView as a WebWidget. This
- // special case will be removed when top-level frames get WebFrameWidgets.
- if (localRoot->isMainFrame()) {
- m_webView->attachCompositorAnimationTimeline(compositorTimeline);
- } else {
- WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot);
- // FIXME: The following conditional is only needed for staging until the
- // Chromium patch lands that instantiates a WebFrameWidget.
- if (!webFrame->frameWidget()) {
- m_webView->attachCompositorAnimationTimeline(compositorTimeline);
- return;
- }
- DCHECK(webFrame);
- DCHECK(webFrame->frameWidget());
- toWebFrameWidgetImpl(webFrame->frameWidget())->attachCompositorAnimationTimeline(compositorTimeline);
- }
+ WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->localRoot();
+ webFrame->frameWidget()->attachCompositorAnimationTimeline(compositorTimeline);
}
-void ChromeClientImpl::detachCompositorAnimationTimeline(CompositorAnimationTimeline* compositorTimeline, LocalFrame* localRoot)
+void ChromeClientImpl::detachCompositorAnimationTimeline(CompositorAnimationTimeline* compositorTimeline, LocalFrame* localFrame)
{
- // FIXME: For top-level frames we still use the WebView as a WebWidget. This
- // special case will be removed when top-level frames get WebFrameWidgets.
- if (localRoot->isMainFrame()) {
- m_webView->detachCompositorAnimationTimeline(compositorTimeline);
- } else {
- WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot);
- // FIXME: The following conditional is only needed for staging until the
- // Chromium patch lands that instantiates a WebFrameWidget.
- if (!webFrame->frameWidget()) {
- m_webView->detachCompositorAnimationTimeline(compositorTimeline);
- return;
- }
- DCHECK(webFrame);
- DCHECK(webFrame->frameWidget());
- toWebFrameWidgetImpl(webFrame->frameWidget())->detachCompositorAnimationTimeline(compositorTimeline);
- }
+ WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localFrame)->localRoot();
+ if (webFrame->frameWidget())
+ webFrame->frameWidget()->detachCompositorAnimationTimeline(compositorTimeline);
}
void ChromeClientImpl::enterFullScreenForElement(Element* element)

Powered by Google App Engine
This is Rietveld 408576698