| 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 c5c679656570f87722b183927bd5d1313e4cd934..8bcc1d44a50cce03287326eed62254f6d110dab8 100644
|
| --- a/content/browser/loader/resource_dispatcher_host_impl.cc
|
| +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
|
| @@ -53,6 +53,7 @@
|
| #include "content/browser/renderer_host/render_view_host_delegate.h"
|
| #include "content/browser/renderer_host/render_view_host_impl.h"
|
| #include "content/browser/resource_context_impl.h"
|
| +#include "content/browser/service_worker/service_worker_provider_host.h"
|
| #include "content/browser/service_worker/service_worker_request_handler.h"
|
| #include "content/browser/streams/stream.h"
|
| #include "content/browser/streams/stream_context.h"
|
| @@ -1368,7 +1369,7 @@ void ResourceDispatcherHostImpl::BeginRequest(
|
| 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.request_body, nullptr);
|
|
|
| // Have the appcache associate its extra info with the request.
|
| AppCacheInterceptor::SetExtraRequestInfo(
|
| @@ -1948,7 +1949,8 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
|
| ResourceContext* resource_context,
|
| int frame_tree_node_id,
|
| const NavigationRequestInfo& info,
|
| - NavigationURLLoaderImplCore* loader) {
|
| + NavigationURLLoaderImplCore* loader,
|
| + ServiceWorkerContextWrapper* service_worker_context) {
|
| // PlzNavigate: BeginNavigationRequest currently should only be used for the
|
| // browser-side navigations project.
|
| CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| @@ -2013,10 +2015,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);
|
| @@ -2082,8 +2085,26 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
|
| blob_context->context()->GetBlobDataFromPublicURL(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;
|
| + // TODO: sync loads should set skip_service_worker to true.
|
| + ServiceWorkerRequestHandler::InitializeHandler(
|
| + new_request.get(),
|
| + service_worker_context,
|
| + blob_context,
|
| + (filter_ != nullptr) ? filter_->child_id() : -1,
|
| + info.common_params.service_worker_provider_id,
|
| + info.begin_params.skip_service_worker,
|
| + FETCH_REQUEST_MODE_SAME_ORIGIN,
|
| + FETCH_CREDENTIALS_MODE_INCLUDE,
|
| + FetchRedirectMode::MANUAL_MODE,
|
| + resource_type,
|
| + info.begin_params.request_context_type,
|
| + frame_type,
|
| + info.request_body,
|
| + loader);
|
| +
|
| // TODO(davidben): Attach AppCacheInterceptor.
|
|
|
| scoped_ptr<ResourceHandler> handler(new NavigationResourceHandler(
|
|
|