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

Unified Diff: third_party/WebKit/Source/core/loader/LinkLoader.cpp

Issue 2165653004: Don't wait for AppCache for link rel preloads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't wait for appcache for link rel preloads Created 4 years, 5 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/loader/LinkLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/LinkLoader.cpp b/third_party/WebKit/Source/core/loader/LinkLoader.cpp
index eb58c35ce12e76d34fc70a3266582634b811175b..d777e1ce78fb3d41105ce841f52d18e2d1562e22 100644
--- a/third_party/WebKit/Source/core/loader/LinkLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/LinkLoader.cpp
@@ -302,7 +302,7 @@ static Resource* preloadIfNeeded(const LinkRelAttribute& relAttribute, const KUR
}
void LinkLoader::loadLinksFromHeader(const String& headerValue, const KURL& baseURL, Document* document, const NetworkHintsInterface& networkHintsInterface,
- CanLoadResources canLoadResources, ViewportDescriptionWrapper* viewportDescriptionWrapper)
+ CanLoadResources canLoadResources, MediaPreloadPolicy mediaPolicy, ViewportDescriptionWrapper* viewportDescriptionWrapper)
{
if (!document || headerValue.isEmpty())
return;
@@ -311,6 +311,11 @@ void LinkLoader::loadLinksFromHeader(const String& headerValue, const KURL& base
if (!header.valid() || header.url().isEmpty() || header.rel().isEmpty())
continue;
+ if (mediaPolicy == OnlyLoadMedia && header.media().isEmpty())
+ continue;
+ if (mediaPolicy == OnlyLoadNonMedia && !header.media().isEmpty())
+ continue;
+
LinkRelAttribute relAttribute(header.rel());
KURL url(baseURL, header.url());
// Sanity check to avoid re-entrancy here.

Powered by Google App Engine
This is Rietveld 408576698