| 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 b0969b5979c3686eba4063d994b5c8116a81687a..058d36c9c8deff00ed588ccbb2d06e9486a9eb76 100644
|
| --- a/content/browser/loader/resource_dispatcher_host_impl.cc
|
| +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
|
| @@ -1633,9 +1633,10 @@ ResourceDispatcherHostImpl::CreateResourceHandler(
|
| handler.reset(new CrossSiteResourceHandler(std::move(handler), request));
|
| }
|
|
|
| - return AddStandardHandlers(request, request_data.resource_type,
|
| - resource_context, filter_->appcache_service(),
|
| - child_id, route_id, std::move(handler));
|
| + return AddStandardHandlers(
|
| + request, request_data.resource_type, resource_context,
|
| + request_data.fetch_request_context_type, filter_->appcache_service(),
|
| + child_id, route_id, std::move(handler));
|
| }
|
|
|
| std::unique_ptr<ResourceHandler>
|
| @@ -1643,6 +1644,7 @@ ResourceDispatcherHostImpl::AddStandardHandlers(
|
| net::URLRequest* request,
|
| ResourceType resource_type,
|
| ResourceContext* resource_context,
|
| + RequestContextType fetch_request_context_type,
|
| AppCacheService* appcache_service,
|
| int child_id,
|
| int route_id,
|
| @@ -1669,8 +1671,10 @@ ResourceDispatcherHostImpl::AddStandardHandlers(
|
| // Add a NavigationResourceThrottle for navigations.
|
| // PlzNavigate: the throttle is unnecessary as communication with the UI
|
| // thread is handled by the NavigationURLloader.
|
| - if (!IsBrowserSideNavigationEnabled() && IsResourceTypeFrame(resource_type))
|
| - throttles.push_back(new NavigationResourceThrottle(request, delegate()));
|
| + if (!IsBrowserSideNavigationEnabled() && IsResourceTypeFrame(resource_type)) {
|
| + throttles.push_back(new NavigationResourceThrottle(
|
| + request, delegate(), fetch_request_context_type));
|
| + }
|
|
|
| if (delegate_) {
|
| delegate_->RequestBeginning(request,
|
| @@ -2253,15 +2257,18 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
|
| std::unique_ptr<ResourceHandler> handler(
|
| new NavigationResourceHandler(new_request.get(), loader, delegate()));
|
|
|
| + // TODO(carlosk): set the RequestContextType in a more correct way, if needed.
|
| + // Source of inspiration: determineRequestContextFromNavigationType in
|
| + // FrameLoader.cpp.
|
| // TODO(davidben): Pass in the appropriate appcache_service. Also fix the
|
| // dependency on child_id/route_id. Those are used by the ResourceScheduler;
|
| // currently it's a no-op.
|
| - handler =
|
| - AddStandardHandlers(new_request.get(), resource_type, resource_context,
|
| - nullptr, // appcache_service
|
| - -1, // child_id
|
| - -1, // route_id
|
| - std::move(handler));
|
| + handler = AddStandardHandlers(new_request.get(), resource_type,
|
| + resource_context, REQUEST_CONTEXT_TYPE_LOCATION,
|
| + nullptr, // appcache_service
|
| + -1, // child_id
|
| + -1, // route_id
|
| + std::move(handler));
|
|
|
| BeginRequestInternal(std::move(new_request), std::move(handler));
|
| }
|
|
|