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

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

Issue 2440803002: Filter out data urls in the preload scanner (Closed)
Patch Set: yoav comments 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..987d4934d08675ec09703962a470d2d0b78d552f 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -241,9 +241,12 @@ class TokenPreloadScanner::StartTagScanner {
ReferrerPolicy referrerPolicy = (m_referrerPolicy != ReferrerPolicyDefault)
? m_referrerPolicy
: documentReferrerPolicy;
- std::unique_ptr<PreloadRequest> request = PreloadRequest::create(
+ std::unique_ptr<PreloadRequest> request = PreloadRequest::createIfNeeded(
Yoav Weiss 2016/10/25 04:34:14 same nit: should we auto this variable?
Charlie Harrison 2016/10/25 13:32:48 Done.
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());

Powered by Google App Engine
This is Rietveld 408576698