Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: content/browser/browser_context.cc

Issue 10831116: Move SessionStorageNamespace entirely into NavigationController and support StoragePartitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged ToT Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_context.cc
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 02fe1cdd5131f9bd1933419f35b84ef7ff5fcdcf..15735c9b81cebe77ff0d9be0c2f72126d898dd99 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -32,8 +32,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) {
@@ -41,12 +42,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|.
@@ -153,6 +159,14 @@ DOMStorageContext* BrowserContext::GetDOMStorageContext(
return partition->dom_storage_context();
}
+DOMStorageContext* BrowserContext::GetDOMStorageContextByPartitionId(
+ 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

Powered by Google App Engine
This is Rietveld 408576698