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

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

Issue 2893233002: Network traffic annotation added to URLLoaderImpl. (Closed)
Patch Set: Comment addressed, Merged. 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
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | content/child/resource_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::URLLoaderAssociatedRequest 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) override { 232 mojom::URLLoaderClientPtr client,
233 const net::MutableNetworkTrafficAnnotationTag&
234 traffic_annotation) override {
233 DCHECK_CURRENTLY_ON(BrowserThread::UI); 235 DCHECK_CURRENTLY_ON(BrowserThread::UI);
234 if (request.url.host_piece() == kChromeUINetworkViewCacheHost) { 236 if (request.url.host_piece() == kChromeUINetworkViewCacheHost) {
235 storage_partition_->network_context()->HandleViewCacheRequest( 237 storage_partition_->network_context()->HandleViewCacheRequest(
236 request.url, std::move(client)); 238 request.url, std::move(client));
237 return; 239 return;
238 } 240 }
239 241
240 if (request.url.host_piece() == kChromeUIBlobInternalsHost) { 242 if (request.url.host_piece() == kChromeUIBlobInternalsHost) {
241 BrowserThread::PostTask( 243 BrowserThread::PostTask(
242 BrowserThread::IO, FROM_HERE, 244 BrowserThread::IO, FROM_HERE,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } // namespace 291 } // namespace
290 292
291 mojom::URLLoaderFactoryPtr CreateWebUIURLLoader(FrameTreeNode* node) { 293 mojom::URLLoaderFactoryPtr CreateWebUIURLLoader(FrameTreeNode* node) {
292 int ftn_id = node->frame_tree_node_id(); 294 int ftn_id = node->frame_tree_node_id();
293 if (g_factories.Get()[ftn_id].get() == nullptr) 295 if (g_factories.Get()[ftn_id].get() == nullptr)
294 g_factories.Get()[ftn_id] = base::MakeUnique<WebUIURLLoaderFactory>(node); 296 g_factories.Get()[ftn_id] = base::MakeUnique<WebUIURLLoaderFactory>(node);
295 return g_factories.Get()[ftn_id]->CreateBinding(); 297 return g_factories.Get()[ftn_id]->CreateBinding();
296 } 298 }
297 299
298 } // namespace content 300 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | content/child/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698