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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp

Issue 2192493002: Let blink scheduler know when background parsing a document (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix some test failures Created 4 years, 5 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/core/html/parser/HTMLDocumentParser.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
index 9bff3174f8c8f6e52f212064c8efa52098f3588e..cea54fd6cfad692634c1a75a7fa5701484896d1f 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -721,6 +721,9 @@ void HTMLDocumentParser::startBackgroundParser()
ASSERT(document());
m_haveBackgroundParser = true;
+ if (document()->frame() && document()->frame()->frameScheduler())
+ document()->frame()->frameScheduler()->setDocumentParsingInBackground(true);
+
// Make sure that a resolver is set up, so that the correct viewport dimensions will be fed to the background parser and preload scanner.
if (document()->loader())
document()->ensureStyleResolver();
@@ -762,6 +765,9 @@ void HTMLDocumentParser::stopBackgroundParser()
ASSERT(m_haveBackgroundParser);
m_haveBackgroundParser = false;
+ if (document()->frame() && document()->frame()->frameScheduler())
+ document()->frame()->frameScheduler()->setDocumentParsingInBackground(false);
+
// Make this sync, as lsan triggers on some unittests if the task runner is
// used. Note that these lifetimes will be much more concrete if
// ParseHTMLOnMainThread lands (the lookahead parser will be a member).

Powered by Google App Engine
This is Rietveld 408576698