| 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" |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 request_interceptors.push_back( | 452 request_interceptors.push_back( |
| 453 ForeignFetchRequestHandler::CreateInterceptor( | 453 ForeignFetchRequestHandler::CreateInterceptor( |
| 454 browser_context_->GetResourceContext()) | 454 browser_context_->GetResourceContext()) |
| 455 .release()); | 455 .release()); |
| 456 } | 456 } |
| 457 request_interceptors.push_back(new AppCacheInterceptor()); | 457 request_interceptors.push_back(new AppCacheInterceptor()); |
| 458 | 458 |
| 459 // These calls must happen after StoragePartitionImpl::Create(). | 459 // These calls must happen after StoragePartitionImpl::Create(). |
| 460 if (partition_domain.empty()) { | 460 if (partition_domain.empty()) { |
| 461 partition->SetURLRequestContext( | 461 partition->SetURLRequestContext( |
| 462 GetContentClient()->browser()->CreateRequestContext( | 462 browser_context_->CreateRequestContext( |
| 463 browser_context_, &protocol_handlers, | 463 &protocol_handlers, std::move(request_interceptors))); |
| 464 std::move(request_interceptors))); | |
| 465 } else { | 464 } else { |
| 466 partition->SetURLRequestContext( | 465 partition->SetURLRequestContext( |
| 467 GetContentClient()->browser()->CreateRequestContextForStoragePartition( | 466 browser_context_->CreateRequestContextForStoragePartition( |
| 468 browser_context_, partition->GetPath(), in_memory, | 467 partition->GetPath(), in_memory, &protocol_handlers, |
| 469 &protocol_handlers, std::move(request_interceptors))); | 468 std::move(request_interceptors))); |
| 470 } | 469 } |
| 471 partition->SetMediaURLRequestContext( | 470 partition->SetMediaURLRequestContext( |
| 472 partition_domain.empty() ? | 471 partition_domain.empty() ? |
| 473 browser_context_->GetMediaRequestContext() : | 472 browser_context_->GetMediaRequestContext() : |
| 474 browser_context_->GetMediaRequestContextForStoragePartition( | 473 browser_context_->GetMediaRequestContextForStoragePartition( |
| 475 partition->GetPath(), in_memory)); | 474 partition->GetPath(), in_memory)); |
| 476 | 475 |
| 477 PostCreateInitialization(partition, in_memory); | 476 PostCreateInitialization(partition, in_memory); |
| 478 | 477 |
| 479 return partition; | 478 return partition; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 | 609 |
| 611 // We do not call InitializeURLRequestContext() for media contexts because, | 610 // We do not call InitializeURLRequestContext() for media contexts because, |
| 612 // other than the HTTP cache, the media contexts share the same backing | 611 // other than the HTTP cache, the media contexts share the same backing |
| 613 // objects as their associated "normal" request context. Thus, the previous | 612 // objects as their associated "normal" request context. Thus, the previous |
| 614 // call serves to initialize the media request context for this storage | 613 // call serves to initialize the media request context for this storage |
| 615 // partition as well. | 614 // partition as well. |
| 616 } | 615 } |
| 617 } | 616 } |
| 618 | 617 |
| 619 } // namespace content | 618 } // namespace content |
| OLD | NEW |