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

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

Issue 2440803002: Filter out data urls in the preload scanner (Closed)
Patch Set: also block ref urls 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/HTMLPreloadScanner.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
index b664912074081ba5a020b8c0980045d2d856b970..7c10534f140a5d1f7ed134576a9d0204b1409448 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -244,6 +244,9 @@ class TokenPreloadScanner::StartTagScanner {
std::unique_ptr<PreloadRequest> request = PreloadRequest::create(
initiatorFor(m_tagImpl), position, m_urlToLoad, predictedBaseURL, type,
referrerPolicy, resourceWidth, clientHintsPreferences, requestType);
+ if (!request)
+ return nullptr;
+
request->setCrossOrigin(m_crossOrigin);
request->setNonce(m_nonce);
request->setCharset(charset());
@@ -481,6 +484,7 @@ class TokenPreloadScanner::StartTagScanner {
return false;
if (match(m_tagImpl, inputTag) && !m_inputIsImage)
return false;
+
Charlie Harrison 2016/10/21 21:38:55 will remove
return true;
}

Powered by Google App Engine
This is Rietveld 408576698