| 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 29d41a9264be66660703c96f111108d8afdf8980..b18c6e2ef28e882181000c60a79dd9bb7ed09276 100644
|
| --- a/content/browser/loader/resource_dispatcher_host_impl.cc
|
| +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
|
| @@ -1841,10 +1841,13 @@ ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo(
|
| int child_id,
|
| int render_view_route_id,
|
| int render_frame_route_id,
|
| + int service_worker_provider_id,
|
| bool download,
|
| - ResourceContext* context) {
|
| + ResourceContext* context,
|
| + ServiceWorkerContextWrapper* service_worker_context) {
|
| return new ResourceRequestInfoImpl(
|
| - ResourceRequesterInfo::CreateForDownloadOrPageSave(child_id),
|
| + ResourceRequesterInfo::CreateForDownloadOrPageSave(
|
| + child_id, service_worker_context),
|
| render_view_route_id,
|
| -1, // frame_tree_node_id
|
| 0, MakeRequestID(), render_frame_route_id,
|
| @@ -2403,17 +2406,34 @@ void ResourceDispatcherHostImpl::InitializeURLRequest(
|
| int render_process_host_id,
|
| int render_view_routing_id,
|
| int render_frame_routing_id,
|
| - ResourceContext* context) {
|
| + int service_worker_provider_id,
|
| + ResourceContext* context,
|
| + ServiceWorkerContextWrapper* service_worker_context) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| DCHECK(!request->is_pending());
|
|
|
| SetReferrerForRequest(request, referrer);
|
|
|
| - ResourceRequestInfoImpl* info =
|
| - CreateRequestInfo(render_process_host_id, render_view_routing_id,
|
| - render_frame_routing_id, is_download, context);
|
| + ResourceRequestInfoImpl* info = CreateRequestInfo(
|
| + render_process_host_id, render_view_routing_id, render_frame_routing_id,
|
| + service_worker_provider_id, is_download, context, service_worker_context);
|
| // Request takes ownership.
|
| info->AssociateWithRequest(request);
|
| +
|
| + if (!service_worker_context || service_worker_provider_id == -1)
|
| + return;
|
| +
|
| + ChromeBlobStorageContext* blob_context =
|
| + GetChromeBlobStorageContextForResourceContext(context);
|
| +
|
| + ServiceWorkerRequestHandler::InitializeHandler(
|
| + request, service_worker_context, blob_context->context(),
|
| + render_process_host_id, service_worker_provider_id, false,
|
| + FETCH_REQUEST_MODE_NO_CORS, FETCH_CREDENTIALS_MODE_INCLUDE,
|
| + FetchRedirectMode::FOLLOW_MODE,
|
| + RESOURCE_TYPE_SUB_RESOURCE /* TODO(horo) */,
|
| + REQUEST_CONTEXT_TYPE_DOWNLOAD, REQUEST_CONTEXT_FRAME_TYPE_NONE,
|
| + scoped_refptr<ResourceRequestBodyImpl>() /* TODO(horo) */);
|
| }
|
|
|
| void ResourceDispatcherHostImpl::BeginURLRequest(
|
|
|