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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 const std::string& partition_name, | 389 const std::string& partition_name, |
390 bool in_memory) { | 390 bool in_memory) { |
391 // Find the previously created partition if it's available. | 391 // Find the previously created partition if it's available. |
392 StoragePartitionConfig partition_config( | 392 StoragePartitionConfig partition_config( |
393 partition_domain, partition_name, in_memory); | 393 partition_domain, partition_name, in_memory); |
394 | 394 |
395 PartitionMap::const_iterator it = partitions_.find(partition_config); | 395 PartitionMap::const_iterator it = partitions_.find(partition_config); |
396 if (it != partitions_.end()) | 396 if (it != partitions_.end()) |
397 return it->second; | 397 return it->second; |
398 | 398 |
399 base::FilePath partition_path = | 399 base::FilePath relative_partition_path = |
400 browser_context_->GetPath().Append( | 400 GetStoragePartitionPath(partition_domain, partition_name); |
401 GetStoragePartitionPath(partition_domain, partition_name)); | 401 |
402 StoragePartitionImpl* partition = | 402 StoragePartitionImpl* partition = StoragePartitionImpl::Create( |
403 StoragePartitionImpl::Create(browser_context_, in_memory, | 403 browser_context_, in_memory, relative_partition_path); |
404 partition_path); | |
405 partitions_[partition_config] = partition; | 404 partitions_[partition_config] = partition; |
406 | 405 |
407 partition->GetQuotaManager()->SetTemporaryStorageEvictionPolicy( | 406 partition->GetQuotaManager()->SetTemporaryStorageEvictionPolicy( |
408 GetContentClient()->browser()->GetTemporaryStorageEvictionPolicy( | 407 GetContentClient()->browser()->GetTemporaryStorageEvictionPolicy( |
409 browser_context_)); | 408 browser_context_)); |
410 | 409 |
411 ChromeBlobStorageContext* blob_storage_context = | 410 ChromeBlobStorageContext* blob_storage_context = |
412 ChromeBlobStorageContext::GetFor(browser_context_); | 411 ChromeBlobStorageContext::GetFor(browser_context_); |
413 StreamContext* stream_context = StreamContext::GetFor(browser_context_); | 412 StreamContext* stream_context = StreamContext::GetFor(browser_context_); |
414 ProtocolHandlerMap protocol_handlers; | 413 ProtocolHandlerMap protocol_handlers; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 | 615 |
617 // We do not call InitializeURLRequestContext() for media contexts because, | 616 // We do not call InitializeURLRequestContext() for media contexts because, |
618 // other than the HTTP cache, the media contexts share the same backing | 617 // other than the HTTP cache, the media contexts share the same backing |
619 // objects as their associated "normal" request context. Thus, the previous | 618 // objects as their associated "normal" request context. Thus, the previous |
620 // call serves to initialize the media request context for this storage | 619 // call serves to initialize the media request context for this storage |
621 // partition as well. | 620 // partition as well. |
622 } | 621 } |
623 } | 622 } |
624 | 623 |
625 } // namespace content | 624 } // namespace content |
OLD | NEW |