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

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

Issue 2411863002: [NoStatePrefetch] Kill renderer after preload scanning (Closed)
Patch Set: Created 4 years, 2 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 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() {

Powered by Google App Engine
This is Rietveld 408576698