| OLD | NEW |
| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 mojom::URLLoaderFactoryPtr CreateBinding() { | 220 mojom::URLLoaderFactoryPtr CreateBinding() { |
| 221 return loader_factory_bindings_.CreateInterfacePtrAndBind(this); | 221 return loader_factory_bindings_.CreateInterfacePtrAndBind(this); |
| 222 } | 222 } |
| 223 | 223 |
| 224 // mojom::URLLoaderFactory implementation: | 224 // mojom::URLLoaderFactory implementation: |
| 225 void CreateLoaderAndStart(mojom::URLLoaderRequest loader, | 225 void CreateLoaderAndStart(mojom::URLLoaderRequest loader, |
| 226 int32_t routing_id, | 226 int32_t routing_id, |
| 227 int32_t request_id, | 227 int32_t request_id, |
| 228 uint32_t options, | 228 uint32_t options, |
| 229 const ResourceRequest& request, | 229 const ResourceRequest& request, |
| 230 mojom::URLLoaderClientPtr client) override { | 230 mojom::URLLoaderClientPtr client, |
| 231 const net::MutableNetworkTrafficAnnotationTag& |
| 232 traffic_annotation) override { |
| 231 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 233 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 232 if (request.url.host_piece() == kChromeUINetworkViewCacheHost) { | 234 if (request.url.host_piece() == kChromeUINetworkViewCacheHost) { |
| 233 storage_partition_->network_context()->HandleViewCacheRequest( | 235 storage_partition_->network_context()->HandleViewCacheRequest( |
| 234 request.url, std::move(client)); | 236 request.url, std::move(client)); |
| 235 return; | 237 return; |
| 236 } | 238 } |
| 237 | 239 |
| 238 if (request.url.host_piece() == kChromeUIBlobInternalsHost) { | 240 if (request.url.host_piece() == kChromeUIBlobInternalsHost) { |
| 239 BrowserThread::PostTask( | 241 BrowserThread::PostTask( |
| 240 BrowserThread::IO, FROM_HERE, | 242 BrowserThread::IO, FROM_HERE, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } // namespace | 289 } // namespace |
| 288 | 290 |
| 289 mojom::URLLoaderFactoryPtr GetWebUIURLLoader(FrameTreeNode* node) { | 291 mojom::URLLoaderFactoryPtr GetWebUIURLLoader(FrameTreeNode* node) { |
| 290 int ftn_id = node->frame_tree_node_id(); | 292 int ftn_id = node->frame_tree_node_id(); |
| 291 if (g_factories.Get()[ftn_id].get() == nullptr) | 293 if (g_factories.Get()[ftn_id].get() == nullptr) |
| 292 g_factories.Get()[ftn_id] = base::MakeUnique<WebUIURLLoaderFactory>(node); | 294 g_factories.Get()[ftn_id] = base::MakeUnique<WebUIURLLoaderFactory>(node); |
| 293 return g_factories.Get()[ftn_id]->CreateBinding(); | 295 return g_factories.Get()[ftn_id]->CreateBinding(); |
| 294 } | 296 } |
| 295 | 297 |
| 296 } // namespace content | 298 } // namespace content |
| OLD | NEW |