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

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

Issue 2160403002: Dont preload from link headers if the response came from MemoryCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 fb6549e54502baa420190857417aa49970623f6a..eb58c35ce12e76d34fc70a3266582634b811175b 100644
--- a/third_party/WebKit/Source/core/loader/LinkLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/LinkLoader.cpp
@@ -313,6 +313,9 @@ void LinkLoader::loadLinksFromHeader(const String& headerValue, const KURL& base
LinkRelAttribute relAttribute(header.rel());
KURL url(baseURL, header.url());
+ // Sanity check to avoid re-entrancy here.
+ if (url == baseURL)
+ continue;
Yoav Weiss 2016/07/19 21:14:22 Is this specific to MemoryCache? Seems like if I'm
Charlie Harrison 2016/07/19 21:23:52 Ah no this isn't specific to memory cache. I added
Yoav Weiss 2016/07/19 21:29:48 I don't think you should remove it. I'm probably m
if (canLoadResources != OnlyLoadResources) {
if (RuntimeEnabledFeatures::linkHeaderEnabled())
dnsPrefetchIfNeeded(relAttribute, url, *document, networkHintsInterface, LinkCalledFromHeader);

Powered by Google App Engine
This is Rietveld 408576698