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 b06f1a3626107c7e89c5a6eb89320b9066e73ab7..b63b3d2659b8049dd34df94a74a181a9b2c0b3aa 100644 |
--- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp |
+++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp |
@@ -48,6 +48,7 @@ |
#include "core/loader/DocumentLoader.h" |
#include "core/loader/LinkLoader.h" |
#include "core/loader/NavigationScheduler.h" |
+#include "core/loader/PrerendererClient.h" |
#include "platform/CrossThreadFunctional.h" |
#include "platform/Histogram.h" |
#include "platform/SharedBuffer.h" |
@@ -923,6 +924,12 @@ void HTMLDocumentParser::end() { |
ASSERT(!isDetached()); |
ASSERT(!isScheduledForResume()); |
+ // Early determine if running a prefetch. At later stages the |document()| may |
droger
2016/10/12 09:12:58
Nit: You're still calling document() at the end. M
pasko
2016/10/12 13:59:40
The comment is accurate, but confusing a lot, I ag
|
+ // be unavailable. |
+ bool prefetchOnly = false; |
+ if (document()->isPrefetchOnly()) |
+ prefetchOnly = true; |
+ |
if (m_haveBackgroundParser) |
stopBackgroundParser(); |
@@ -931,6 +938,8 @@ void HTMLDocumentParser::end() { |
m_treeBuilder->finished(); |
DocumentParser::stopParsing(); |
+ if (prefetchOnly) |
+ document()->onPrefetchFinished(); |
} |
void HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd() { |