Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: content/browser/loader/navigation_url_loader_network_service.cc

Issue 2902653002: Get main frame and subframe AppCache loads to work. (Closed)
Patch Set: Fix compile failure by using the host_ member. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/loader/navigation_url_loader_network_service.h" 5 #include "content/browser/loader/navigation_url_loader_network_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
11 #include "content/browser/appcache/appcache_navigation_handle.h" 11 #include "content/browser/appcache/appcache_navigation_handle.h"
12 #include "content/browser/appcache/appcache_navigation_handle_core.h"
13 #include "content/browser/appcache/appcache_url_loader_factory.h"
12 #include "content/browser/blob_storage/chrome_blob_storage_context.h" 14 #include "content/browser/blob_storage/chrome_blob_storage_context.h"
13 #include "content/browser/frame_host/frame_tree_node.h" 15 #include "content/browser/frame_host/frame_tree_node.h"
14 #include "content/browser/frame_host/navigation_request_info.h" 16 #include "content/browser/frame_host/navigation_request_info.h"
15 #include "content/browser/loader/navigation_resource_handler.h" 17 #include "content/browser/loader/navigation_resource_handler.h"
16 #include "content/browser/loader/navigation_resource_throttle.h" 18 #include "content/browser/loader/navigation_resource_throttle.h"
17 #include "content/browser/loader/navigation_url_loader_delegate.h" 19 #include "content/browser/loader/navigation_url_loader_delegate.h"
18 #include "content/browser/resource_context_impl.h" 20 #include "content/browser/resource_context_impl.h"
19 #include "content/browser/service_worker/service_worker_navigation_handle.h" 21 #include "content/browser/service_worker/service_worker_navigation_handle.h"
20 #include "content/browser/service_worker/service_worker_navigation_handle_core.h " 22 #include "content/browser/service_worker/service_worker_navigation_handle_core.h "
21 #include "content/browser/service_worker/service_worker_request_handler.h" 23 #include "content/browser/service_worker/service_worker_request_handler.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // gave us, or otherwise fallback to the default. 101 // gave us, or otherwise fallback to the default.
100 mojom::URLLoaderFactory* factory; 102 mojom::URLLoaderFactory* factory;
101 if (url_loader_factory_ptr) { 103 if (url_loader_factory_ptr) {
102 factory = url_loader_factory_ptr.get(); 104 factory = url_loader_factory_ptr.get();
103 } else { 105 } else {
104 if (factory_from_ui.is_valid()) { 106 if (factory_from_ui.is_valid()) {
105 url_loader_factory_ptr.Bind(std::move(factory_from_ui)); 107 url_loader_factory_ptr.Bind(std::move(factory_from_ui));
106 factory = url_loader_factory_ptr.get(); 108 factory = url_loader_factory_ptr.get();
107 } else { 109 } else {
108 if (appcache_handle_core) { 110 if (appcache_handle_core) {
109 factory = url_loader_factory_getter->GetAppCacheFactory()->get(); 111 factory = url_loader_factory_getter->GetAppCacheFactory()->get();
michaeln 2017/05/24 00:59:32 I think I see a problem with this function. It see
112 // TODO(ananta)
113 // Change this when we don't use URLLoaderFactories in the browser.
114 AppCacheURLLoaderFactory::SetAppCacheHost(appcache_handle_core->host());
ananta 2017/05/24 02:14:03 The plan for now is to have each factory call the
110 } else { 115 } else {
111 factory = url_loader_factory_getter->GetNetworkFactory()->get(); 116 factory = url_loader_factory_getter->GetNetworkFactory()->get();
112 } 117 }
113 } 118 }
114 } 119 }
115 120
116 factory->CreateLoaderAndStart( 121 factory->CreateLoaderAndStart(
117 std::move(url_loader_request), 0 /* routing_id? */, 0 /* request_id? */, 122 std::move(url_loader_request), 0 /* routing_id? */, 0 /* request_id? */,
118 mojom::kURLLoadOptionSendSSLInfo, *resource_request, 123 mojom::kURLLoadOptionSendSSLInfo, *resource_request,
119 std::move(url_loader_client_to_pass)); 124 std::move(url_loader_client_to_pass));
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 TRACE_EVENT_ASYNC_END2("navigation", "Navigation timeToResponseStarted", 280 TRACE_EVENT_ASYNC_END2("navigation", "Navigation timeToResponseStarted",
276 this, "&NavigationURLLoaderNetworkService", this, 281 this, "&NavigationURLLoaderNetworkService", this,
277 "success", false); 282 "success", false);
278 283
279 delegate_->OnRequestFailed(completion_status.exists_in_cache, 284 delegate_->OnRequestFailed(completion_status.exists_in_cache,
280 completion_status.error_code); 285 completion_status.error_code);
281 } 286 }
282 } 287 }
283 288
284 } // namespace content 289 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698