OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/storage_partition_impl_map.h" | 5 #include "content/browser/storage_partition_impl_map.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/files/file_enumerator.h" | 12 #include "base/files/file_enumerator.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
15 #include "base/location.h" | 15 #include "base/location.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
21 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
22 #include "base/task_scheduler/post_task.h" | 22 #include "base/task_scheduler/post_task.h" |
23 #include "base/threading/sequenced_worker_pool.h" | 23 #include "base/threading/sequenced_worker_pool.h" |
24 #include "base/threading/thread_task_runner_handle.h" | 24 #include "base/threading/thread_task_runner_handle.h" |
25 #include "build/build_config.h" | 25 #include "build/build_config.h" |
26 #include "content/browser/appcache/appcache_interceptor.h" | 26 #include "content/browser/appcache/appcache_interceptor.h" |
27 #include "content/browser/appcache/chrome_appcache_service.h" | 27 #include "content/browser/appcache/chrome_appcache_service.h" |
28 #include "content/browser/background_fetch/background_fetch_context.h" | 28 #include "content/browser/background_fetch/background_fetch_context.h" |
29 #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 29 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
| 30 #include "content/browser/devtools/devtools_url_request_interceptor.h" |
30 #include "content/browser/fileapi/browser_file_system_helper.h" | 31 #include "content/browser/fileapi/browser_file_system_helper.h" |
31 #include "content/browser/loader/resource_request_info_impl.h" | 32 #include "content/browser/loader/resource_request_info_impl.h" |
32 #include "content/browser/resource_context_impl.h" | 33 #include "content/browser/resource_context_impl.h" |
33 #include "content/browser/service_worker/foreign_fetch_request_handler.h" | 34 #include "content/browser/service_worker/foreign_fetch_request_handler.h" |
34 #include "content/browser/service_worker/service_worker_request_handler.h" | 35 #include "content/browser/service_worker/service_worker_request_handler.h" |
35 #include "content/browser/storage_partition_impl.h" | 36 #include "content/browser/storage_partition_impl.h" |
36 #include "content/browser/streams/stream.h" | 37 #include "content/browser/streams/stream.h" |
37 #include "content/browser/streams/stream_context.h" | 38 #include "content/browser/streams/stream_context.h" |
38 #include "content/browser/streams/stream_registry.h" | 39 #include "content/browser/streams/stream_registry.h" |
39 #include "content/browser/streams/stream_url_request_job.h" | 40 #include "content/browser/streams/stream_url_request_job.h" |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 browser_context_->GetResourceContext(), blob_storage_context) | 423 browser_context_->GetResourceContext(), blob_storage_context) |
423 .release()); | 424 .release()); |
424 } | 425 } |
425 | 426 |
426 protocol_handlers[kChromeDevToolsScheme] = | 427 protocol_handlers[kChromeDevToolsScheme] = |
427 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( | 428 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( |
428 CreateDevToolsProtocolHandler( | 429 CreateDevToolsProtocolHandler( |
429 browser_context_->GetResourceContext())); | 430 browser_context_->GetResourceContext())); |
430 | 431 |
431 URLRequestInterceptorScopedVector request_interceptors; | 432 URLRequestInterceptorScopedVector request_interceptors; |
| 433 request_interceptors.push_back( |
| 434 base::MakeUnique<DevToolsURLRequestInterceptor>(browser_context_)); |
432 request_interceptors.push_back(ServiceWorkerRequestHandler::CreateInterceptor( | 435 request_interceptors.push_back(ServiceWorkerRequestHandler::CreateInterceptor( |
433 browser_context_->GetResourceContext())); | 436 browser_context_->GetResourceContext())); |
434 if (ForeignFetchRequestHandler::IsForeignFetchEnabled()) { | 437 if (ForeignFetchRequestHandler::IsForeignFetchEnabled()) { |
435 request_interceptors.push_back( | 438 request_interceptors.push_back( |
436 ForeignFetchRequestHandler::CreateInterceptor( | 439 ForeignFetchRequestHandler::CreateInterceptor( |
437 browser_context_->GetResourceContext())); | 440 browser_context_->GetResourceContext())); |
438 } | 441 } |
439 request_interceptors.push_back(base::MakeUnique<AppCacheInterceptor>()); | 442 request_interceptors.push_back(base::MakeUnique<AppCacheInterceptor>()); |
440 | 443 |
441 // These calls must happen after StoragePartitionImpl::Create(). | 444 // These calls must happen after StoragePartitionImpl::Create(). |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 | 599 |
597 // We do not call InitializeURLRequestContext() for media contexts because, | 600 // We do not call InitializeURLRequestContext() for media contexts because, |
598 // other than the HTTP cache, the media contexts share the same backing | 601 // other than the HTTP cache, the media contexts share the same backing |
599 // objects as their associated "normal" request context. Thus, the previous | 602 // objects as their associated "normal" request context. Thus, the previous |
600 // call serves to initialize the media request context for this storage | 603 // call serves to initialize the media request context for this storage |
601 // partition as well. | 604 // partition as well. |
602 } | 605 } |
603 } | 606 } |
604 | 607 |
605 } // namespace content | 608 } // namespace content |
OLD | NEW |