Chromium Code Reviews| Index: content/browser/renderer_host/resource_dispatcher_host_impl.cc |
| diff --git a/content/browser/renderer_host/resource_dispatcher_host_impl.cc b/content/browser/renderer_host/resource_dispatcher_host_impl.cc |
| index f83e90ccb58f008489a55f3220c28a7f885b773d..a76dfeb62c1b35b16f8283c929e6862741caacf5 100644 |
| --- a/content/browser/renderer_host/resource_dispatcher_host_impl.cc |
| +++ b/content/browser/renderer_host/resource_dispatcher_host_impl.cc |
| @@ -515,7 +515,6 @@ net::Error ResourceDispatcherHostImpl::BeginDownload( |
| const net::URLRequestContext* request_context = context->GetRequestContext(); |
|
mmenke
2012/06/20 18:33:50
nit: Suggest you move this down to just above whe
shalev
2012/06/20 20:13:12
Done.
|
| request->set_referrer(MaybeStripReferrer(GURL(request->referrer())).spec()); |
| - request->set_context(request_context); |
| int extra_load_flags = net::LOAD_IS_DOWNLOAD; |
| if (prefer_cache) { |
| // If there is upload data attached, only retrieve from cache because there |
| @@ -936,7 +935,10 @@ void ResourceDispatcherHostImpl::BeginRequest( |
| if (deferred_loader.get()) { |
| request = deferred_loader->request(); |
| } else { |
| - new_request.reset(new net::URLRequest(request_data.url, NULL)); |
| + new_request.reset(new net::URLRequest( |
| + request_data.url, |
| + NULL, |
| + filter_->GetURLRequestContext(request_data.resource_type))); |
| request = new_request.get(); |
| request->set_method(request_data.method); |
| @@ -954,8 +956,6 @@ void ResourceDispatcherHostImpl::BeginRequest( |
| request->set_load_flags(load_flags); |
| - request->set_context( |
| - filter_->GetURLRequestContext(request_data.resource_type)); |
| request->set_priority(DetermineRequestPriority(request_data.resource_type)); |
| // Set upload data. |
| @@ -1250,7 +1250,8 @@ void ResourceDispatcherHostImpl::BeginSaveFile( |
| return; |
| } |
| - scoped_ptr<net::URLRequest> request(new net::URLRequest(url, NULL)); |
| + scoped_ptr<net::URLRequest> request( |
| + new net::URLRequest(url, NULL, context->GetRequestContext())); |
| request->set_method("GET"); |
| request->set_referrer(MaybeStripReferrer(referrer.url).spec()); |
| webkit_glue::ConfigureURLRequestForReferrerPolicy(request.get(), |
| @@ -1258,7 +1259,6 @@ void ResourceDispatcherHostImpl::BeginSaveFile( |
| // So far, for saving page, we need fetch content from cache, in the |
| // future, maybe we can use a configuration to configure this behavior. |
| request->set_load_flags(net::LOAD_PREFERRING_CACHE); |
| - request->set_context(context->GetRequestContext()); |
| // Since we're just saving some resources we need, disallow downloading. |
| ResourceRequestInfoImpl* extra_info = |