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

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

Issue 1982263002: Fix preloadScanner double download issue with link preload and media (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 01b52462b2cb4fdd8fa468a035ef476442b0cea4..1cb0661a96c90c95802fd19a4180b38e8fa0b607 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -205,12 +205,15 @@ public:
PassOwnPtr<PreloadRequest> createPreloadRequest(const KURL& predictedBaseURL, const SegmentedString& source, const ClientHintsPreferences& clientHintsPreferences, const PictureData& pictureData, const ReferrerPolicy documentReferrerPolicy)
{
PreloadRequest::RequestType requestType = PreloadRequest::RequestTypePreload;
- if (shouldPreconnect())
+ if (shouldPreconnect()) {
requestType = PreloadRequest::RequestTypePreconnect;
- else if (isLinkRelPreload())
- requestType = PreloadRequest::RequestTypeLinkRelPreload;
- else if (!shouldPreload() || !m_matchedMediaAttribute)
+ } else if (!shouldPreload() || !m_matchedMediaAttribute) {
return nullptr;
+ }
+
+ if (isLinkRelPreload()) {
Nate Chapin 2016/05/17 17:16:55 Which of these cases really should be mutually exc
Yoav Weiss 2016/05/17 21:45:48 Good point. I changed the conditions to represent
+ requestType = PreloadRequest::RequestTypeLinkRelPreload;
+ }
TextPosition position = TextPosition(source.currentLine(), source.currentColumn());
FetchRequest::ResourceWidth resourceWidth;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698