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

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

Issue 47923008: Block execution of failed 'crossorigin' <script>s. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Keep OriginRestriction on FetchRequest Created 7 years, 1 month 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.h
diff --git a/Source/core/fetch/ResourceFetcher.h b/Source/core/fetch/ResourceFetcher.h
index 431bacd1ed022f8bd97e83cc244c1bc6f2f484ef..fc580c7bb3d7b70232693e49f135f6f9ea92493a 100644
--- a/Source/core/fetch/ResourceFetcher.h
+++ b/Source/core/fetch/ResourceFetcher.h
@@ -61,6 +61,11 @@ class KURL;
class ResourceTimingInfo;
class ResourceLoaderSet;
+enum CrossOriginEnabled {
+ NotCrossOriginEnabled,
+ PotentiallyCrossOriginEnabled // Indicates "potentially CORS-enabled fetch" in HTML standard.
+};
+
// The ResourceFetcher provides a per-context interface to the MemoryCache
// and enforces a bunch of security checks and rules for resource revalidation.
// Its lifetime is roughly per-DocumentLoader, in that it is generally created
@@ -130,7 +135,7 @@ public:
void preload(Resource::Type, FetchRequest&, const String& charset);
void checkForPendingPreloads();
void printPreloadStats();
- bool canAccess(Resource*);
+ bool canAccess(Resource*, CrossOriginEnabled, FetchRequest::OriginRestriction = FetchRequest::UseDefaultOriginRestrictionForType);
void setDefersLoading(bool);
void stopFetching();
@@ -178,7 +183,7 @@ private:
ResourceRequestCachePolicy resourceRequestCachePolicy(const ResourceRequest&, Resource::Type);
void addAdditionalRequestHeaders(ResourceRequest&, Resource::Type);
- bool canRequest(Resource::Type, const KURL&, const ResourceLoaderOptions&, bool forPreload = false);
+ bool canRequest(Resource::Type, const KURL&, const ResourceLoaderOptions&, bool forPreload, FetchRequest::OriginRestriction);
bool checkInsecureContent(Resource::Type, const KURL&, MixedContentBlockingTreatment) const;
static bool resourceNeedsLoad(Resource*, const FetchRequest&, RevalidationPolicy);

Powered by Google App Engine
This is Rietveld 408576698