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

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

Issue 2867333002: Revert "Separate preaload matching from MemoryCache" (Closed)
Patch Set: Revert "Separate preaload matching from MemoryCache" Created 3 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
Index: third_party/WebKit/Source/core/loader/DocumentLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
index d54daaaf746fbd5a2a6a3fed6f48fa6960c3e6ca..db77967ab6c8f5ebb6d4107d8bf7a8d0ce5d5860 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -217,6 +217,11 @@ Resource* DocumentLoader::StartPreload(Resource::Type type,
NOTREACHED();
}
+ // CSP layout tests verify that preloads are subject to access checks by
+ // seeing if they are in the `preload started` list. Therefore do not add
+ // them to the list if the load is immediately denied.
+ if (resource && !resource->GetResourceError().IsAccessCheck())
+ Fetcher()->PreloadStarted(resource);
return resource;
}

Powered by Google App Engine
This is Rietveld 408576698