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

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

Issue 2343053002: Service worker bypass for resource requests from suborigins (Closed)
Patch Set: Update to handle MemCache Created 4 years, 3 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/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
index 5ff0d0d3861a31c60532f733a76016d704734229..71fb8dff6de7e7ee0d887c681f4cafac2a62d40a 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -1032,6 +1032,10 @@ bool ResourceFetcher::startLoad(Resource* resource)
ResourceRequest request(resource->resourceRequest());
willSendRequest(resource->identifier(), request, ResourceResponse(), resource->options());
+ SecurityOrigin* sourceOrigin = context().getSecurityOrigin();
+ if (sourceOrigin && sourceOrigin->hasSuborigin())
+ request.setSkipServiceWorker(WebURLRequest::SkipServiceWorker::All);
falken 2016/09/20 03:48:57 I know this is Blink but can we comment here why s
jww 2016/09/20 04:27:47 Hahaha, I like you're style :-) I always get ticke
+
ResourceLoader* loader = ResourceLoader::create(this, resource);
if (resource->shouldBlockLoadEvent())
m_loaders.add(loader);
@@ -1039,7 +1043,7 @@ bool ResourceFetcher::startLoad(Resource* resource)
m_nonBlockingLoaders.add(loader);
storeResourceTimingInitiatorInformation(resource);
- resource->setFetcherSecurityOrigin(context().getSecurityOrigin());
+ resource->setFetcherSecurityOrigin(sourceOrigin);
loader->start(request, context().loadingTaskRunner(), context().defersLoading());
return true;
}

Powered by Google App Engine
This is Rietveld 408576698