| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 browser_context_->GetResourceContext(), | 406 browser_context_->GetResourceContext(), |
| 407 browser_context_->IsOffTheRecord(), | 407 browser_context_->IsOffTheRecord(), |
| 408 partition->GetAppCacheService(), | 408 partition->GetAppCacheService(), |
| 409 blob_storage_context)); | 409 blob_storage_context)); |
| 410 } | 410 } |
| 411 protocol_handlers[kChromeDevToolsScheme] = | 411 protocol_handlers[kChromeDevToolsScheme] = |
| 412 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( | 412 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( |
| 413 CreateDevToolsProtocolHandler(browser_context_->GetResourceContext(), | 413 CreateDevToolsProtocolHandler(browser_context_->GetResourceContext(), |
| 414 browser_context_->IsOffTheRecord())); | 414 browser_context_->IsOffTheRecord())); |
| 415 | 415 |
| 416 ProtocolHandlerScopedVector protocol_interceptors; | 416 URLRequestInterceptorScopedVector request_interceptors; |
| 417 protocol_interceptors.push_back( | 417 request_interceptors.push_back( |
| 418 ServiceWorkerRequestHandler::CreateInterceptor().release()); | 418 ServiceWorkerRequestHandler::CreateInterceptor().release()); |
| 419 | 419 |
| 420 // These calls must happen after StoragePartitionImpl::Create(). | 420 // These calls must happen after StoragePartitionImpl::Create(). |
| 421 if (partition_domain.empty()) { | 421 if (partition_domain.empty()) { |
| 422 partition->SetURLRequestContext( | 422 partition->SetURLRequestContext( |
| 423 GetContentClient()->browser()->CreateRequestContext( | 423 GetContentClient()->browser()->CreateRequestContext( |
| 424 browser_context_, | 424 browser_context_, |
| 425 &protocol_handlers, | 425 &protocol_handlers, |
| 426 protocol_interceptors.Pass())); | 426 request_interceptors.Pass())); |
| 427 } else { | 427 } else { |
| 428 partition->SetURLRequestContext( | 428 partition->SetURLRequestContext( |
| 429 GetContentClient()->browser()->CreateRequestContextForStoragePartition( | 429 GetContentClient()->browser()->CreateRequestContextForStoragePartition( |
| 430 browser_context_, | 430 browser_context_, |
| 431 partition->GetPath(), | 431 partition->GetPath(), |
| 432 in_memory, | 432 in_memory, |
| 433 &protocol_handlers, | 433 &protocol_handlers, |
| 434 protocol_interceptors.Pass())); | 434 request_interceptors.Pass())); |
| 435 } | 435 } |
| 436 partition->SetMediaURLRequestContext( | 436 partition->SetMediaURLRequestContext( |
| 437 partition_domain.empty() ? | 437 partition_domain.empty() ? |
| 438 browser_context_->GetMediaRequestContext() : | 438 browser_context_->GetMediaRequestContext() : |
| 439 browser_context_->GetMediaRequestContextForStoragePartition( | 439 browser_context_->GetMediaRequestContextForStoragePartition( |
| 440 partition->GetPath(), in_memory)); | 440 partition->GetPath(), in_memory)); |
| 441 | 441 |
| 442 PostCreateInitialization(partition, in_memory); | 442 PostCreateInitialization(partition, in_memory); |
| 443 | 443 |
| 444 return partition; | 444 return partition; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 | 561 |
| 562 // We do not call InitializeURLRequestContext() for media contexts because, | 562 // We do not call InitializeURLRequestContext() for media contexts because, |
| 563 // other than the HTTP cache, the media contexts share the same backing | 563 // other than the HTTP cache, the media contexts share the same backing |
| 564 // objects as their associated "normal" request context. Thus, the previous | 564 // objects as their associated "normal" request context. Thus, the previous |
| 565 // call serves to initialize the media request context for this storage | 565 // call serves to initialize the media request context for this storage |
| 566 // partition as well. | 566 // partition as well. |
| 567 } | 567 } |
| 568 } | 568 } |
| 569 | 569 |
| 570 } // namespace content | 570 } // namespace content |
| OLD | NEW |