summaryrefslogtreecommitdiffstats
path: root/content/browser/storage_partition_impl_map.h
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-18 08:54:34 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-18 08:54:34 +0000
commit4c3a235850730f45ee734eef73e79fe386826950 (patch)
tree953f9688e8bd31fd156178ef3715433cabf8fc61 /content/browser/storage_partition_impl_map.h
parent9b4ba94c9d95328e811771e74b8a8bb8580731d8 (diff)
downloadchromium_src-4c3a235850730f45ee734eef73e79fe386826950.zip
chromium_src-4c3a235850730f45ee734eef73e79fe386826950.tar.gz
chromium_src-4c3a235850730f45ee734eef73e79fe386826950.tar.bz2
Move StoragePartition into content/public and remove BrowserContext::GetDOMStorageContext().
Eventually all the storage context accessors will be removed from BrowserContext. Instead, users should retrieve the storage context from the StoragePartition. This also changes RenderProcessHost to take in a StoragePartition removing the need for a re-lookup its storage contexts. BUG=85121,143486 Review URL: https://chromiumcodereview.appspot.com/10837230 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152251 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/storage_partition_impl_map.h')
-rw-r--r--content/browser/storage_partition_impl_map.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/content/browser/storage_partition_impl_map.h b/content/browser/storage_partition_impl_map.h
new file mode 100644
index 0000000..d4a66e7
--- /dev/null
+++ b/content/browser/storage_partition_impl_map.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_
+#define CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_
+
+#include <map>
+#include <string>
+
+#include "base/callback_forward.h"
+#include "base/supports_user_data.h"
+#include "content/public/browser/browser_context.h"
+
+class FilePath;
+
+namespace content {
+
+class BrowserContext;
+class StoragePartitionImpl;
+
+// A std::string to StoragePartition map for use with SupportsUserData APIs.
+class StoragePartitionImplMap : public base::SupportsUserData::Data {
+ public:
+ explicit StoragePartitionImplMap(BrowserContext* browser_context);
+
+ virtual ~StoragePartitionImplMap();
+
+ // This map retains ownership of the returned StoragePartition objects.
+ StoragePartitionImpl* Get(const std::string& partition_id);
+
+ void ForEach(const BrowserContext::StoragePartitionCallback& callback);
+
+ private:
+ // This must always be called *after* |partition| has been added to the
+ // partitions_.
+ //
+ // TODO(ajwong): Is there a way to make it so that Get()'s implementation
+ // doesn't need to be aware of this ordering? Revisit when refactoring
+ // ResourceContext and AppCache to respect storage partitions.
+ void PostCreateInitialization(StoragePartitionImpl* partition,
+ const FilePath& partition_path);
+
+ BrowserContext* browser_context_; // Not Owned.
+ std::map<std::string, StoragePartitionImpl*> partitions_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_