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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1300043003: Centralize deferred commit conditions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index b8ed71c2ffbf1b6a0f134acfbb9a14ffe50fc356..dd1a2a03a9dc7e9550e348bfdf5f574da71b05f4 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -3916,43 +3916,28 @@ void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag
void WebViewImpl::willInsertBody(WebLocalFrameImpl* 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();
+ resumeTreeViewCommitsIfNeeded(webframe);
}
void WebViewImpl::didFinishDocumentLoad(WebLocalFrameImpl* webframe)
{
- if (webframe != mainFrameImpl())
- return;
- // If we finished parsing and there's no sheets to load start painting.
- if (webframe->frame()->document()->isRenderingReady())
- resumeTreeViewCommits();
+ resumeTreeViewCommitsIfNeeded(webframe);
}
void WebViewImpl::didRemoveAllPendingStylesheet(WebLocalFrameImpl* 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();
+ resumeTreeViewCommitsIfNeeded(webframe);
}
-void WebViewImpl::resumeTreeViewCommits()
+void WebViewImpl::resumeTreeViewCommitsIfNeeded(WebLocalFrameImpl* webframe)
{
- if (m_layerTreeView)
- m_layerTreeView->setDeferCommits(false);
+ if (webframe != mainFrameImpl())
+ return;
+ if (!webframe->frame()->document()->shouldProcessFrameLifecycle())
+ return;
+ if (!m_layerTreeView)
+ return;
+ 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