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

Unified Diff: content/browser/service_worker/foreign_fetch_request_handler.cc

Issue 2110163002: Correctly set initiated_in_secure_context on requests from shared/service workers, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@skip-service-worker-foreign-fetch
Patch Set: wrap layout test at 80 columns Created 4 years, 6 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 | « no previous file | content/renderer/service_worker/service_worker_context_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/foreign_fetch_request_handler.cc
diff --git a/content/browser/service_worker/foreign_fetch_request_handler.cc b/content/browser/service_worker/foreign_fetch_request_handler.cc
index 068e3fab304ac5131089500c54fe9e2428bfd8e0..9b213107576e47752ea75ff9f498be888be9d1aa 100644
--- a/content/browser/service_worker/foreign_fetch_request_handler.cc
+++ b/content/browser/service_worker/foreign_fetch_request_handler.cc
@@ -69,16 +69,16 @@ void ForeignFetchRequestHandler::InitializeHandler(
if (!initiated_in_secure_context)
return;
- if (!context_wrapper->OriginHasForeignFetchRegistrations(
- request->url().GetOrigin())) {
+ if (ServiceWorkerUtils::IsMainResourceType(resource_type))
return;
- }
if (request->initiator().IsSameOriginWith(url::Origin(request->url())))
return;
- if (ServiceWorkerUtils::IsMainResourceType(resource_type))
+ if (!context_wrapper->OriginHasForeignFetchRegistrations(
+ request->url().GetOrigin())) {
return;
+ }
// Any more precise checks to see if the request should be intercepted are
// asynchronous, so just create our handler in all cases.
« no previous file with comments | « no previous file | content/renderer/service_worker/service_worker_context_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698