Chromium Code Reviews| 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 2d7512b63ae834050f1393383a7b88a9a5eedd4e..4bf71b84d6d54467d4556ac82f43eadb4a22c42f 100644 |
| --- a/content/browser/loader/resource_dispatcher_host_impl.cc |
| +++ b/content/browser/loader/resource_dispatcher_host_impl.cc |
| @@ -1957,7 +1957,8 @@ void ResourceDispatcherHostImpl::FinishedWithResourcesForRequest( |
| void ResourceDispatcherHostImpl::BeginNavigationRequest( |
| ResourceContext* resource_context, |
| const NavigationRequestInfo& info, |
| - NavigationURLLoaderImplCore* loader) { |
| + NavigationURLLoaderImplCore* loader, |
| + const scoped_refptr<ServiceWorkerContextWrapper>& service_worker_context) { |
| // PlzNavigate: BeginNavigationRequest currently should only be used for the |
| // browser-side navigations project. |
| CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| @@ -2022,10 +2023,11 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest( |
| new_request->SetLoadFlags(load_flags); |
| + storage::BlobStorageContext* blob_context = GetBlobStorageContext( |
| + GetChromeBlobStorageContextForResourceContext(resource_context)); |
| + |
| // Resolve elements from request_body and prepare upload data. |
| if (info.request_body.get()) { |
| - storage::BlobStorageContext* blob_context = GetBlobStorageContext( |
| - GetChromeBlobStorageContextForResourceContext(resource_context)); |
| AttachRequestBodyBlobDataHandles( |
| info.request_body.get(), |
| blob_context); |
| @@ -2084,15 +2086,23 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest( |
| if (new_request->url().SchemeIs(url::kBlobScheme)) { |
| // Hang on to a reference to ensure the blob is not released prior |
| // to the job being started. |
| - ChromeBlobStorageContext* blob_context = |
| + ChromeBlobStorageContext* chrome_blob_context = |
| GetChromeBlobStorageContextForResourceContext(resource_context); |
| storage::BlobProtocolHandler::SetRequestedBlobDataHandle( |
| new_request.get(), |
| - blob_context->context()->GetBlobDataFromPublicURL(new_request->url())); |
| + chrome_blob_context->context()->GetBlobDataFromPublicURL( |
|
michaeln
2015/10/07 01:16:44
you could directly use the existing local here
blo
Fabrice (no longer in Chrome)
2015/10/07 12:59:43
It seems like we should have been using the same t
|
| + new_request->url())); |
| } |
| - // TODO(davidben): Attach ServiceWorkerRequestHandler. |
| - // TODO(michaeln): Help out with this and that. |
| + RequestContextFrameType frame_type = |
| + info.is_main_frame ? REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL |
| + : REQUEST_CONTEXT_FRAME_TYPE_NESTED; |
| + ServiceWorkerRequestHandler::InitializeForNavigation( |
| + new_request.get(), service_worker_context.get(), blob_context, |
| + info.service_worker_provider_id, info.begin_params.skip_service_worker, |
| + resource_type, info.begin_params.request_context_type, frame_type, |
| + info.request_body); |
| + |
| // TODO(davidben): Attach AppCacheInterceptor. |
| scoped_ptr<ResourceHandler> handler(new NavigationResourceHandler( |