Chromium Code Reviews

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2105503002: Skip foreign fetch when the skipServiceWorker flag is set on a request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix resource loading Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 83c1ec7d7456e7940c12a8e343c27203787036df..a389c40737d470e353a8b74a877348a563653398 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1566,12 +1566,12 @@ void ResourceDispatcherHostImpl::BeginRequest(
// Initialize the service worker handler for the request. We don't use
// ServiceWorker for synchronous loads to avoid renderer deadlocks.
- const bool should_skip_service_worker =
- request_data.skip_service_worker || is_sync_load;
+ const SkipServiceWorker should_skip_service_worker =
+ is_sync_load ? SkipServiceWorker::ALL : request_data.skip_service_worker;
ServiceWorkerRequestHandler::InitializeHandler(
new_request.get(), filter_->service_worker_context(), blob_context,
child_id, request_data.service_worker_provider_id,
- should_skip_service_worker,
+ should_skip_service_worker != SkipServiceWorker::NONE,
request_data.fetch_request_mode, request_data.fetch_credentials_mode,
request_data.fetch_redirect_mode, request_data.resource_type,
request_data.fetch_request_context_type, request_data.fetch_frame_type,
@@ -1582,11 +1582,11 @@ void ResourceDispatcherHostImpl::BeginRequest(
ForeignFetchRequestHandler::InitializeHandler(
new_request.get(), filter_->service_worker_context(), blob_context,
child_id, request_data.service_worker_provider_id,
- should_skip_service_worker,
- request_data.fetch_request_mode, request_data.fetch_credentials_mode,
- request_data.fetch_redirect_mode, request_data.resource_type,
- request_data.fetch_request_context_type, request_data.fetch_frame_type,
- request_data.request_body, request_data.initiated_in_secure_context);
+ should_skip_service_worker, request_data.fetch_request_mode,
+ request_data.fetch_credentials_mode, request_data.fetch_redirect_mode,
+ request_data.resource_type, request_data.fetch_request_context_type,
+ request_data.fetch_frame_type, request_data.request_body,
+ request_data.initiated_in_secure_context);
}
// Have the appcache associate its extra info with the request.
« no previous file with comments | « no previous file | content/browser/service_worker/foreign_fetch_request_handler.h » ('j') | content/child/web_url_loader_impl.cc » ('J')

Powered by Google App Engine