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