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 fb12a9b95407a2d9276c7bbe9279646f22f837d8..8e4b5bdf68c7009b07aac2ff8a8af59a9bc3df32 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. |
|
Mike West
2016/07/20 09:52:46
Ditto.
carlosk
2016/07/20 10:12:02
Ditto too.
|
| // 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)); |
| } |