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

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

Issue 2231523002: Make ResourceFetcher return Resources with LoadError instead of nullptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, resolve comment rewrap conflicts. 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/loader/DocumentLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
index 0941688f9d7cb391cf48ac5abf71978743334c37..7f689758f73ce58cb90169608e096f5f9c89130e 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -190,7 +190,10 @@ Resource* DocumentLoader::startPreload(Resource::Type type,
NOTREACHED();
}
- if (resource)
+ // 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->resourceError().isAccessCheck())
fetcher()->preloadStarted(resource);
return resource;
}
@@ -681,7 +684,13 @@ void DocumentLoader::startLoadingMainResource() {
mainResourceLoadOptions);
m_mainResource =
RawResource::fetchMainResource(fetchRequest, fetcher(), m_substituteData);
- if (!m_mainResource) {
+
+ // PlzNavigate:
+ // The final access checks are still performed here, potentially rejecting
+ // the "provisional" load, but the browser side already expects the renderer
+ // to be able to unconditionally commit.
+ if (!m_mainResource || (m_frame->settings()->browserSideNavigationEnabled() &&
+ m_mainResource->errorOccurred())) {
m_request = ResourceRequest(blankURL());
maybeLoadEmpty();
return;

Powered by Google App Engine
This is Rietveld 408576698