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> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/command_line.h" | 11 #include "base/command_line.h" |
10 #include "base/files/file_enumerator.h" | 12 #include "base/files/file_enumerator.h" |
11 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
12 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
13 #include "base/location.h" | 15 #include "base/location.h" |
14 #include "base/macros.h" | 16 #include "base/macros.h" |
15 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
16 #include "base/stl_util.h" | 18 #include "base/stl_util.h" |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 ForeignFetchRequestHandler::CreateInterceptor( | 458 ForeignFetchRequestHandler::CreateInterceptor( |
457 browser_context_->GetResourceContext()) | 459 browser_context_->GetResourceContext()) |
458 .release()); | 460 .release()); |
459 } | 461 } |
460 request_interceptors.push_back(new AppCacheInterceptor()); | 462 request_interceptors.push_back(new AppCacheInterceptor()); |
461 | 463 |
462 // These calls must happen after StoragePartitionImpl::Create(). | 464 // These calls must happen after StoragePartitionImpl::Create(). |
463 if (partition_domain.empty()) { | 465 if (partition_domain.empty()) { |
464 partition->SetURLRequestContext( | 466 partition->SetURLRequestContext( |
465 GetContentClient()->browser()->CreateRequestContext( | 467 GetContentClient()->browser()->CreateRequestContext( |
466 browser_context_, | 468 browser_context_, &protocol_handlers, |
467 &protocol_handlers, | 469 std::move(request_interceptors))); |
468 request_interceptors.Pass())); | |
469 } else { | 470 } else { |
470 partition->SetURLRequestContext( | 471 partition->SetURLRequestContext( |
471 GetContentClient()->browser()->CreateRequestContextForStoragePartition( | 472 GetContentClient()->browser()->CreateRequestContextForStoragePartition( |
472 browser_context_, | 473 browser_context_, partition->GetPath(), in_memory, |
473 partition->GetPath(), | 474 &protocol_handlers, std::move(request_interceptors))); |
474 in_memory, | |
475 &protocol_handlers, | |
476 request_interceptors.Pass())); | |
477 } | 475 } |
478 partition->SetMediaURLRequestContext( | 476 partition->SetMediaURLRequestContext( |
479 partition_domain.empty() ? | 477 partition_domain.empty() ? |
480 browser_context_->GetMediaRequestContext() : | 478 browser_context_->GetMediaRequestContext() : |
481 browser_context_->GetMediaRequestContextForStoragePartition( | 479 browser_context_->GetMediaRequestContextForStoragePartition( |
482 partition->GetPath(), in_memory)); | 480 partition->GetPath(), in_memory)); |
483 | 481 |
484 GetContentClient()->browser()->GetAdditionalNavigatorConnectServices( | 482 GetContentClient()->browser()->GetAdditionalNavigatorConnectServices( |
485 partition->GetNavigatorConnectContext()); | 483 partition->GetNavigatorConnectContext()); |
486 | 484 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 | 617 |
620 // We do not call InitializeURLRequestContext() for media contexts because, | 618 // We do not call InitializeURLRequestContext() for media contexts because, |
621 // other than the HTTP cache, the media contexts share the same backing | 619 // other than the HTTP cache, the media contexts share the same backing |
622 // objects as their associated "normal" request context. Thus, the previous | 620 // objects as their associated "normal" request context. Thus, the previous |
623 // call serves to initialize the media request context for this storage | 621 // call serves to initialize the media request context for this storage |
624 // partition as well. | 622 // partition as well. |
625 } | 623 } |
626 } | 624 } |
627 | 625 |
628 } // namespace content | 626 } // namespace content |
OLD | NEW |