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

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

Issue 2498193003: [WIP not ready for review] ServiceWorker Download support.
Patch Set: rebase Created 4 years, 1 month 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: 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(
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.h ('k') | content/browser/loader/resource_requester_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698