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

Side by Side Diff: content/browser/webui/web_ui_url_loader_factory.cc

Issue 2954853002: Use Independent URLLoader
Patch Set: . Created 3 years, 6 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/webui/web_ui_url_loader_factory.h" 5 #include "content/browser/webui/web_ui_url_loader_factory.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 ~WebUIURLLoaderFactory() override {} 218 ~WebUIURLLoaderFactory() override {}
219 219
220 mojom::URLLoaderFactoryPtr CreateBinding() { 220 mojom::URLLoaderFactoryPtr CreateBinding() {
221 mojom::URLLoaderFactoryPtr factory; 221 mojom::URLLoaderFactoryPtr factory;
222 loader_factory_bindings_.AddBinding(this, mojo::MakeRequest(&factory)); 222 loader_factory_bindings_.AddBinding(this, mojo::MakeRequest(&factory));
223 return factory; 223 return factory;
224 } 224 }
225 225
226 // mojom::URLLoaderFactory implementation: 226 // mojom::URLLoaderFactory implementation:
227 void CreateLoaderAndStart(mojom::URLLoaderAssociatedRequest loader, 227 void CreateLoaderAndStart(mojom::URLLoaderRequest loader,
228 int32_t routing_id, 228 int32_t routing_id,
229 int32_t request_id, 229 int32_t request_id,
230 uint32_t options, 230 uint32_t options,
231 const ResourceRequest& request, 231 const ResourceRequest& request,
232 mojom::URLLoaderClientPtr client, 232 mojom::URLLoaderClientPtr client,
233 const net::MutableNetworkTrafficAnnotationTag& 233 const net::MutableNetworkTrafficAnnotationTag&
234 traffic_annotation) override { 234 traffic_annotation) override {
235 DCHECK_CURRENTLY_ON(BrowserThread::UI); 235 DCHECK_CURRENTLY_ON(BrowserThread::UI);
236 if (request.url.host_piece() == kChromeUINetworkViewCacheHost) { 236 if (request.url.host_piece() == kChromeUINetworkViewCacheHost) {
237 storage_partition_->network_context()->HandleViewCacheRequest( 237 storage_partition_->network_context()->HandleViewCacheRequest(
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } // namespace 291 } // namespace
292 292
293 mojom::URLLoaderFactoryPtr CreateWebUIURLLoader(FrameTreeNode* node) { 293 mojom::URLLoaderFactoryPtr CreateWebUIURLLoader(FrameTreeNode* node) {
294 int ftn_id = node->frame_tree_node_id(); 294 int ftn_id = node->frame_tree_node_id();
295 if (g_factories.Get()[ftn_id].get() == nullptr) 295 if (g_factories.Get()[ftn_id].get() == nullptr)
296 g_factories.Get()[ftn_id] = base::MakeUnique<WebUIURLLoaderFactory>(node); 296 g_factories.Get()[ftn_id] = base::MakeUnique<WebUIURLLoaderFactory>(node);
297 return g_factories.Get()[ftn_id]->CreateBinding(); 297 return g_factories.Get()[ftn_id]->CreateBinding();
298 } 298 }
299 299
300 } // namespace content 300 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | content/child/url_loader_client_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698