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). |