Chromium Code Reviews| Index: content/browser/browser_context.cc |
| diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc |
| index fbf5a00c46d7e8a32bbe79b1bba9d969cc317ebf..d1e481c5aa48762bb7e56b196564c9410ce97909 100644 |
| --- a/content/browser/browser_context.cc |
| +++ b/content/browser/browser_context.cc |
| @@ -33,8 +33,9 @@ namespace content { |
| namespace { |
| -StoragePartition* GetStoragePartition(BrowserContext* browser_context, |
| - int renderer_child_id) { |
| +StoragePartition* GetStoragePartitionByPartitionId( |
| + BrowserContext* browser_context, |
| + const std::string& partition_id) { |
| StoragePartitionMap* partition_map = static_cast<StoragePartitionMap*>( |
| browser_context->GetUserData(kStorageParitionMapKeyName)); |
| if (!partition_map) { |
| @@ -42,12 +43,17 @@ StoragePartition* GetStoragePartition(BrowserContext* browser_context, |
| browser_context->SetUserData(kStorageParitionMapKeyName, partition_map); |
| } |
| + return partition_map->Get(partition_id); |
| +} |
| + |
| +StoragePartition* GetStoragePartition(BrowserContext* browser_context, |
| + int renderer_child_id) { |
| const std::string& partition_id = |
| GetContentClient()->browser()->GetStoragePartitionIdForChildProcess( |
| browser_context, |
| renderer_child_id); |
| - return partition_map->Get(partition_id); |
| + return GetStoragePartitionByPartitionId(browser_context, partition_id); |
| } |
| // Run |callback| on each storage partition in |browser_context|. |
| @@ -157,6 +163,14 @@ DOMStorageContext* BrowserContext::GetDOMStorageContext( |
| return partition->dom_storage_context(); |
| } |
| +DOMStorageContext* BrowserContext::GetDOMStorageContextByPartitionId( |
|
Charlie Reis
2012/08/06 20:38:30
Is this worth exposing, as opposed to just calling
awong
2012/08/08 18:08:28
No it's not worth exposing. But the other API doe
|
| + BrowserContext* browser_context, |
| + const std::string& partition_id) { |
| + StoragePartition* partition = |
| + GetStoragePartitionByPartitionId(browser_context, partition_id); |
| + return partition->dom_storage_context(); |
| +} |
| + |
| IndexedDBContext* BrowserContext::GetIndexedDBContext( |
| BrowserContext* browser_context) { |
| // TODO(ajwong): Change this API to require a process id instead of using |