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

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: Fix content shell Created 8 years, 5 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 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(
+ 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