| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, | 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_->GetNetworkContext()->HandleViewCacheRequest( |
| 238 request.url, std::move(client)); | 238 request.url, std::move(client)); |
| 239 return; | 239 return; |
| 240 } | 240 } |
| 241 | 241 |
| 242 if (request.url.host_piece() == kChromeUIBlobInternalsHost) { | 242 if (request.url.host_piece() == kChromeUIBlobInternalsHost) { |
| 243 BrowserThread::PostTask( | 243 BrowserThread::PostTask( |
| 244 BrowserThread::IO, FROM_HERE, | 244 BrowserThread::IO, FROM_HERE, |
| 245 base::BindOnce(&StartBlobInternalsURLLoader, request, | 245 base::BindOnce(&StartBlobInternalsURLLoader, request, |
| 246 client.PassInterface(), | 246 client.PassInterface(), |
| 247 base::Unretained(ChromeBlobStorageContext::GetFor( | 247 base::Unretained(ChromeBlobStorageContext::GetFor( |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |