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

Unified Diff: Source/core/html/parser/HTMLPreloadScanner.cpp

Issue 1196193005: Allow preload scanners to be disabled by Settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@minimaster
Patch Set: add unit test Created 5 years, 6 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
« no previous file with comments | « Source/core/html/parser/HTMLPreloadScanner.h ('k') | Source/core/html/parser/HTMLPreloadScannerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLPreloadScanner.cpp
diff --git a/Source/core/html/parser/HTMLPreloadScanner.cpp b/Source/core/html/parser/HTMLPreloadScanner.cpp
index 9be5f68cdc0d1de07a09b82dea8dfba67030428b..3a5d44e7d604b66577b3802da56728dd43da157e 100644
--- a/Source/core/html/parser/HTMLPreloadScanner.cpp
+++ b/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -478,6 +478,9 @@ static void handleMetaViewport(const String& attributeValue, CachedDocumentParam
template<typename Token>
void TokenPreloadScanner::scanCommon(const Token& token, const SegmentedString& source, PreloadRequestStream& requests)
{
+ if (!m_documentParameters->doHtmlPreloadScanning)
+ return;
+
// Disable preload for documents with AppCache.
if (m_isAppCacheEnabled)
return;
@@ -627,6 +630,7 @@ CachedDocumentParameters::CachedDocumentParameters(Document* document, PassRefPt
{
ASSERT(isMainThread());
ASSERT(document);
+ doHtmlPreloadScanning = !document->settings() || document->settings()->doHtmlPreloadScanning();
if (givenMediaValues)
mediaValues = givenMediaValues;
else
« no previous file with comments | « Source/core/html/parser/HTMLPreloadScanner.h ('k') | Source/core/html/parser/HTMLPreloadScannerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698