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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1324263002: Merge 201232 "Revert of Centralize deferred commit conditions. (..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2490/
Patch Set: Created 5 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
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
===================================================================
--- Source/web/WebViewImpl.cpp (revision 201728)
+++ Source/web/WebViewImpl.cpp (working copy)
@@ -3866,28 +3866,43 @@
void WebViewImpl::willInsertBody(WebLocalFrameImpl* webframe)
{
- resumeTreeViewCommitsIfNeeded(webframe);
+ if (webframe != mainFrameImpl())
+ return;
+
+ if (!m_page->mainFrame()->isLocalFrame())
+ return;
+
+ // If we get to the <body> tag and we have no pending stylesheet and import load, we
+ // can be fairly confident we'll have something sensible to paint soon and
+ // can turn off deferred commits.
+ if (m_page->deprecatedLocalMainFrame()->document()->isRenderingReady())
+ resumeTreeViewCommits();
}
void WebViewImpl::didFinishDocumentLoad(WebLocalFrameImpl* webframe)
{
- resumeTreeViewCommitsIfNeeded(webframe);
+ if (webframe != mainFrameImpl())
+ return;
+ // If we finished parsing and there's no sheets to load start painting.
+ if (webframe->frame()->document()->isRenderingReady())
+ resumeTreeViewCommits();
}
void WebViewImpl::didRemoveAllPendingStylesheet(WebLocalFrameImpl* webframe)
{
- resumeTreeViewCommitsIfNeeded(webframe);
+ if (webframe != mainFrameImpl())
+ return;
+
+ // If we have no more stylesheets to load and we're past the body tag,
+ // we should have something to paint and should start as soon as possible.
+ if (m_page->deprecatedLocalMainFrame()->document()->body())
+ resumeTreeViewCommits();
}
-void WebViewImpl::resumeTreeViewCommitsIfNeeded(WebLocalFrameImpl* webframe)
+void WebViewImpl::resumeTreeViewCommits()
{
- if (webframe != mainFrameImpl())
- return;
- if (!webframe->frame()->document()->shouldProcessFrameLifecycle())
- return;
- if (!m_layerTreeView)
- return;
- m_layerTreeView->setDeferCommits(false);
+ if (m_layerTreeView)
+ m_layerTreeView->setDeferCommits(false);
}
void WebViewImpl::postLayoutResize(WebLocalFrameImpl* webframe)
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698