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

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

Issue 1390943003: Bypass ServiceWorker when the request originates from isolated world. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add browser test Created 5 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
« no previous file with comments | « chrome/test/data/extensions/api_test/service_worker/content_script_fetch/manifest.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
index 49f5f54fbbe7df339a48ade127628ebbee50c4a3..646a208b313264c348a2cc5adf758ebed6e7f87f 100644
--- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
@@ -182,6 +182,14 @@ DocumentThreadableLoader::DocumentThreadableLoader(Document& document, Threadabl
page->chromeClient().didObserveNonGetFetchFromScript();
}
+ if (!document.securityOrigin()->isSameSchemeHostPort(securityOrigin())) {
hiroshige 2015/10/15 08:30:02 nit: Using |m_document| instead of |document| migh
hiroshige 2015/10/15 08:30:02 Just for memo: This condition is also true for fil
+ ResourceRequest newRequest(request);
+ newRequest.setSkipServiceWorker(true);
+ dispatchInitialRequest(newRequest);
+ // |this| may be dead here in async mode.
+ return;
+ }
+
// If the fetch request will be handled by the ServiceWorker, the
// FetchRequestMode of the request must be FetchRequestModeCORS or
// FetchRequestModeCORSWithForcedPreflight. Otherwise the ServiceWorker can
« no previous file with comments | « chrome/test/data/extensions/api_test/service_worker/content_script_fetch/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698