OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_ | |
6 #define CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_ | |
7 | |
8 #include <map> | |
9 #include <string> | |
10 | |
11 #include "base/callback_forward.h" | |
12 #include "base/supports_user_data.h" | |
13 | |
14 namespace content { | |
15 class BrowserContext; | |
16 } | |
17 | |
18 class FilePath; | |
19 class StoragePartition; | |
20 | |
21 // A std::string to StoragePartition map for use with SupportsUserData APIs. | |
22 class StoragePartitionMap : public base::SupportsUserData::Data { | |
jam
2012/07/11 23:36:31
ditto
awong
2012/07/12 20:28:40
Done.
| |
23 public: | |
24 explicit StoragePartitionMap(content::BrowserContext* browser_context); | |
25 | |
26 virtual ~StoragePartitionMap(); | |
27 | |
28 // This map retains ownership of the returned StoragePartition objects. | |
29 StoragePartition* Get(const std::string& partition_id); | |
30 | |
31 void ForEach(const base::Callback<void(StoragePartition*)>& callback); | |
32 | |
33 private: | |
34 // TODO(ajwong): This must always be called *after* it's been added to the | |
35 // 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
| |
36 void PostCreateInitialization(StoragePartition* partition, | |
37 const FilePath& partition_path); | |
38 | |
39 content::BrowserContext* browser_context_; // Not Owned. | |
40 std::map<std::string, StoragePartition*> partitions_; | |
41 }; | |
42 | |
43 #endif // CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_ | |
OLD | NEW |