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

Unified Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 47923008: Block execution of failed 'crossorigin' <script>s. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Minimize code changes + remove redundant leftovers. Created 7 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: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 4570574720574e4d0f0cd1bd2b1c0ea15a3159d9..ac420cdaa8b7347a43d9023245e3c92daebe5759 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -532,7 +532,7 @@ bool ResourceFetcher::canRequest(Resource::Type type, const KURL& url, const Res
return true;
}
-bool ResourceFetcher::canAccess(Resource* resource)
+bool ResourceFetcher::canAccess(Resource* resource, bool isPotentiallyCORSEnabled)
{
// Redirects can change the response URL different from one of request.
if (!canRequest(resource->type(), resource->response().url(), resource->options(), false))
@@ -542,7 +542,7 @@ bool ResourceFetcher::canAccess(Resource* resource)
switch (resource->type()) {
case Resource::Script:
case Resource::ImportResource:
- if (resource->options().requestOriginPolicy == PotentiallyCrossOriginEnabled
+ if (isPotentiallyCORSEnabled
abarth-chromium 2013/11/14 16:34:48 What's the reason for this part of the change? Wh
sof 2013/11/14 17:12:03 Yes, that's why. See the test LayoutTests/http/tes
&& !m_document->securityOrigin()->canRequest(resource->response().url())
&& !resource->passesAccessControlCheck(m_document->securityOrigin(), error)) {
if (frame() && frame()->document())

Powered by Google App Engine
This is Rietveld 408576698