| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
| 13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
| 15 #include "content/browser/blob_storage/blob_internals_url_loader.h" | 15 #include "content/browser/blob_storage/blob_internals_url_loader.h" |
| 16 #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 16 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
| 17 #include "content/browser/frame_host/frame_tree_node.h" | 17 #include "content/browser/frame_host/frame_tree_node.h" |
| 18 #include "content/browser/frame_host/render_frame_host_impl.h" | 18 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 19 #include "content/browser/histogram_internals_url_loader.h" | 19 #include "content/browser/histogram_internals_url_loader.h" |
| 20 #include "content/browser/resource_context_impl.h" | 20 #include "content/browser/resource_context_impl.h" |
| 21 #include "content/browser/storage_partition_impl.h" | 21 #include "content/browser/storage_partition_impl.h" |
| 22 #include "content/browser/webui/network_error_url_loader.h" | 22 #include "content/browser/webui/network_error_url_loader.h" |
| 23 #include "content/browser/webui/url_data_manager_backend.h" | 23 #include "content/browser/webui/url_data_manager_backend.h" |
| 24 #include "content/browser/webui/url_data_source_impl.h" | 24 #include "content/browser/webui/url_data_source_impl.h" |
| 25 #include "content/common/network_service.mojom.h" | |
| 26 #include "content/public/browser/browser_context.h" | 25 #include "content/public/browser/browser_context.h" |
| 27 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| 28 #include "content/public/browser/render_process_host.h" | 27 #include "content/public/browser/render_process_host.h" |
| 29 #include "content/public/browser/web_contents.h" | 28 #include "content/public/browser/web_contents.h" |
| 29 #include "content/public/common/network_service.mojom.h" |
| 30 #include "content/public/common/url_constants.h" | 30 #include "content/public/common/url_constants.h" |
| 31 #include "mojo/public/cpp/bindings/binding_set.h" | 31 #include "mojo/public/cpp/bindings/binding_set.h" |
| 32 #include "third_party/zlib/google/compression_utils.h" | 32 #include "third_party/zlib/google/compression_utils.h" |
| 33 #include "ui/base/template_expressions.h" | 33 #include "ui/base/template_expressions.h" |
| 34 | 34 |
| 35 namespace content { | 35 namespace content { |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 class WebUIURLLoaderFactory; | 39 class WebUIURLLoaderFactory; |
| (...skipping 251 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 |