Chromium Code Reviews| Index: content/browser/loader/navigation_url_loader_network_service.cc |
| diff --git a/content/browser/loader/navigation_url_loader_network_service.cc b/content/browser/loader/navigation_url_loader_network_service.cc |
| index f7d814d7f136aa336bfd55720a1cb4967237c4fe..f379dd94edabb4b6fca86b9883d6e4bbf74e5498 100644 |
| --- a/content/browser/loader/navigation_url_loader_network_service.cc |
| +++ b/content/browser/loader/navigation_url_loader_network_service.cc |
| @@ -9,8 +9,6 @@ |
| #include "base/memory/ptr_util.h" |
| #include "base/trace_event/trace_event.h" |
| #include "content/browser/appcache/appcache_navigation_handle.h" |
| -#include "content/browser/appcache/appcache_navigation_handle_core.h" |
| -#include "content/browser/appcache/appcache_request_handler.h" |
| #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
| #include "content/browser/frame_host/frame_tree_node.h" |
| #include "content/browser/frame_host/navigation_request_info.h" |
| @@ -93,20 +91,6 @@ void PrepareNavigationStartOnIO( |
| request_info->common_params.post_data, web_contents_getter); |
| } |
| - // TODO(scottmg): We need to rework AppCache to have it return a |
| - // URLLoaderFactoryPtr[Info] here. We should also try to have it return |
| - // synchronously in as many cases as possible (especially when there's no |
| - // AppCache) to simplify and speed the common case. |
| - if (false /*appcache_handle_core*/) { |
| - AppCacheRequestHandler::InitializeForNavigationNetworkService( |
| - std::move(resource_request), resource_context, appcache_handle_core, |
| - resource_type, |
| - base::Callback<void( |
| - mojom::URLLoaderFactoryPtrInfo, |
| - std::unique_ptr<ResourceRequest>)>() /* TODO(ananta) */); |
| - return; |
| - } |
| - |
| // If we haven't gotten one from the above, then use the one the UI thread |
| // gave us, or otherwise fallback to the default. |
| mojom::URLLoaderFactory* factory; |
| @@ -117,7 +101,11 @@ void PrepareNavigationStartOnIO( |
| url_loader_factory_ptr.Bind(std::move(factory_from_ui)); |
| factory = url_loader_factory_ptr.get(); |
| } else { |
| - factory = url_loader_factory_getter->GetNetworkFactory()->get(); |
| + if (appcache_handle_core) { |
| + factory = url_loader_factory_getter->GetAppCacheFactory()->get(); |
| + } else { |
| + factory = url_loader_factory_getter->GetNetworkFactory()->get(); |
| + } |
| } |
| } |
| @@ -139,7 +127,8 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService( |
| NavigationURLLoaderDelegate* delegate) |
| : delegate_(delegate), |
| binding_(this), |
| - request_info_(std::move(request_info)) { |
| + request_info_(std::move(request_info)), |
| + request_id_(-1) { |
| DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( |
| @@ -193,6 +182,8 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService( |
| factory_ptr_info = GetWebUIURLLoader(frame_tree_node).PassInterface(); |
| } |
| + request_id_--; |
|
jam
2017/05/19 00:03:50
this class is created for each navigation request,
ananta
2017/05/19 00:23:13
Thanks. I made it a global
|
| + |
| BrowserThread::PostTask( |
| BrowserThread::IO, FROM_HERE, |
| base::Bind(&PrepareNavigationStartOnIO, |
| @@ -271,7 +262,7 @@ void NavigationURLLoaderNetworkService::OnStartLoadingResponseBody( |
| // switching to the data pipe. |
| delegate_->OnResponseStarted(response_, nullptr, std::move(body), ssl_status_, |
| std::unique_ptr<NavigationData>(), |
| - GlobalRequestID() /* request_id? */, |
| + GlobalRequestID(-1, request_id_), |
| false /* is_download? */, false /* is_stream */); |
| } |