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

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: 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 23d77389115ddb12e8372eb3130f683617a86f38..e40f0f66c43c5c2aedd4898134f5f732799fa5cc 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -721,6 +721,8 @@ void HTMLDocumentParser::startBackgroundParser()
ASSERT(document());
m_haveBackgroundParser = true;
+ document()->frame()->frameScheduler()->setDocumentParsedInBackground(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();
@@ -761,6 +763,8 @@ void HTMLDocumentParser::stopBackgroundParser()
ASSERT(m_haveBackgroundParser);
m_haveBackgroundParser = false;
+ document()->frame()->frameScheduler()->setDocumentParsedInBackground(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