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

Unified Diff: content/browser/storage_partition_map.h

Issue 10600009: Support partitioning of storage contexts based on render_id. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Forgot a funciton. 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/storage_partition_map.h
diff --git a/content/browser/storage_partition_map.h b/content/browser/storage_partition_map.h
new file mode 100644
index 0000000000000000000000000000000000000000..fe76ffc8e5592fc575423b900de8955378f3273f
--- /dev/null
+++ b/content/browser/storage_partition_map.h
@@ -0,0 +1,43 @@
+// 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"
+
+namespace content {
+class BrowserContext;
+}
+
+class FilePath;
+class StoragePartition;
+
+// A std::string to StoragePartition map for use with SupportsUserData APIs.
+class StoragePartitionMap : public base::SupportsUserData::Data {
jam 2012/07/11 23:36:31 ditto
awong 2012/07/12 20:28:40 Done.
+ public:
+ explicit StoragePartitionMap(content::BrowserContext* browser_context);
+
+ virtual ~StoragePartitionMap();
+
+ // This map retains ownership of the returned StoragePartition objects.
+ StoragePartition* Get(const std::string& partition_id);
+
+ void ForEach(const base::Callback<void(StoragePartition*)>& callback);
+
+ private:
+ // TODO(ajwong): This must always be called *after* it's been added to the
+ // partition map. This feels dangerous. Should this not be in this class?
jam 2012/07/11 23:36:31 i'm not sure i understand this comment. I would fi
awong 2012/07/12 20:28:40 It's not dangerous for users of the class, but for
+ void PostCreateInitialization(StoragePartition* partition,
+ const FilePath& partition_path);
+
+ content::BrowserContext* browser_context_; // Not Owned.
+ std::map<std::string, StoragePartition*> partitions_;
+};
+
+#endif // CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_

Powered by Google App Engine
This is Rietveld 408576698