Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_ | 5 #ifndef CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_ |
| 6 #define CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_ | 6 #define CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 public: | 25 public: |
| 26 explicit StoragePartitionImplMap(BrowserContext* browser_context); | 26 explicit StoragePartitionImplMap(BrowserContext* browser_context); |
| 27 | 27 |
| 28 virtual ~StoragePartitionImplMap(); | 28 virtual ~StoragePartitionImplMap(); |
| 29 | 29 |
| 30 // This map retains ownership of the returned StoragePartition objects. | 30 // This map retains ownership of the returned StoragePartition objects. |
| 31 StoragePartitionImpl* Get(const std::string& partition_domain, | 31 StoragePartitionImpl* Get(const std::string& partition_domain, |
| 32 const std::string& partition_name, | 32 const std::string& partition_name, |
| 33 bool in_memory); | 33 bool in_memory); |
| 34 | 34 |
| 35 // Starts an asynchronous best-effort attempt to delete all on-disk storage | |
| 36 // related to |site|, avoiding any directories that are in use by | |
| 37 // |partition_map|. | |
|
Charlie Reis
2012/11/16 01:45:10
nit: There's no |partition_map| here. Can you cla
awong
2012/11/16 02:56:10
Was referring to current object. Just removed tha
| |
| 38 void AsyncObliterate(const GURL& site); | |
| 39 | |
| 35 void ForEach(const BrowserContext::StoragePartitionCallback& callback); | 40 void ForEach(const BrowserContext::StoragePartitionCallback& callback); |
| 36 | 41 |
| 37 private: | 42 private: |
| 38 FRIEND_TEST_ALL_PREFIXES(StoragePartitionConfigTest, OperatorLess); | 43 FRIEND_TEST_ALL_PREFIXES(StoragePartitionConfigTest, OperatorLess); |
| 39 | 44 |
| 40 // Each StoragePartition is uniquely identified by which partition domain | 45 // Each StoragePartition is uniquely identified by which partition domain |
| 41 // it belongs to (such as an app or the browser itself), the user supplied | 46 // it belongs to (such as an app or the browser itself), the user supplied |
| 42 // partition name and the bit indicating whether it should be persisted on | 47 // partition name and the bit indicating whether it should be persisted on |
| 43 // disk or not. This structure contains those elements and is used as | 48 // disk or not. This structure contains those elements and is used as |
| 44 // uniqueness key to lookup StoragePartition objects in the global map. | 49 // uniqueness key to lookup StoragePartition objects in the global map. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 // |partition_domain| and |partition_name|. | 91 // |partition_domain| and |partition_name|. |
| 87 static FilePath GetStoragePartitionPath(const std::string& partition_domain, | 92 static FilePath GetStoragePartitionPath(const std::string& partition_domain, |
| 88 const std::string& partition_name); | 93 const std::string& partition_name); |
| 89 | 94 |
| 90 // This must always be called *after* |partition| has been added to the | 95 // This must always be called *after* |partition| has been added to the |
| 91 // partitions_. | 96 // partitions_. |
| 92 // | 97 // |
| 93 // TODO(ajwong): Is there a way to make it so that Get()'s implementation | 98 // TODO(ajwong): Is there a way to make it so that Get()'s implementation |
| 94 // doesn't need to be aware of this ordering? Revisit when refactoring | 99 // doesn't need to be aware of this ordering? Revisit when refactoring |
| 95 // ResourceContext and AppCache to respect storage partitions. | 100 // ResourceContext and AppCache to respect storage partitions. |
| 96 void PostCreateInitialization(StoragePartitionImpl* partition); | 101 void PostCreateInitialization(StoragePartitionImpl* partition, |
| 102 bool in_memory); | |
| 97 | 103 |
| 98 BrowserContext* browser_context_; // Not Owned. | 104 BrowserContext* browser_context_; // Not Owned. |
| 99 PartitionMap partitions_; | 105 PartitionMap partitions_; |
| 100 | 106 |
| 101 // Set to true when the ResourceContext for the associated |browser_context_| | 107 // Set to true when the ResourceContext for the associated |browser_context_| |
| 102 // is initialized. Can never return to false. | 108 // is initialized. Can never return to false. |
| 103 bool resource_context_initialized_; | 109 bool resource_context_initialized_; |
| 104 }; | 110 }; |
| 105 | 111 |
| 106 } // namespace content | 112 } // namespace content |
| 107 | 113 |
| 108 #endif // CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_ | 114 #endif // CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_ |
| OLD | NEW |