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 b78888927b7e4e32fbf65f20c453d3e5a5db2026..65e23c22b2dea98df58efebc71c146c932617a25 100644 |
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp |
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp |
@@ -199,7 +199,10 @@ Resource* DocumentLoader::startPreload(Resource::Type type, FetchRequest& reques |
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; |
} |
@@ -662,7 +665,12 @@ void DocumentLoader::startLoadingMainResource() |
(DoNotBufferData, AllowStoredCredentials, ClientRequestedCredentials, CheckContentSecurityPolicy, DocumentContext)); |
FetchRequest fetchRequest(m_request, FetchInitiatorTypeNames::document, 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())) { |
engedy
2016/09/30 16:03:15
Nate, this is new, please take a look.
The theore
clamy
2016/10/04 14:49:53
I'm not sure I understand fully: is this needed fo
engedy
2016/10/04 23:11:22
Thanks for clarifying.
And yes -- then the proxim
alexmos
2016/10/05 20:58:52
I ran into similar issues with OOPIFs and CSP bloc
engedy
2016/10/05 23:26:25
Yes, that's my understanding.
alexmos
2016/10/06 00:24:06
Not sure about layout tests for this. On the brow
engedy
2016/10/06 00:32:14
All right, will make mention of this on the bug.
|
m_request = ResourceRequest(blankURL()); |
maybeLoadEmpty(); |
return; |