| 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_IMPL_MAP_H_ | 5 #ifndef CONTENT_BROWSER_STORAGE_PARTITION_IMPL_MAP_H_ |
| 6 #define CONTENT_BROWSER_STORAGE_PARTITION_IMPL_MAP_H_ | 6 #define CONTENT_BROWSER_STORAGE_PARTITION_IMPL_MAP_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // fully clean the on-disk storage requiring a call to GarbageCollect() on | 44 // fully clean the on-disk storage requiring a call to GarbageCollect() on |
| 45 // the next browser start. | 45 // the next browser start. |
| 46 void AsyncObliterate(const GURL& site, const base::Closure& on_gc_required); | 46 void AsyncObliterate(const GURL& site, const base::Closure& on_gc_required); |
| 47 | 47 |
| 48 // Examines the on-disk storage and removes any entires that are not listed | 48 // Examines the on-disk storage and removes any entires that are not listed |
| 49 // in the |active_paths|, or in use by current entries in the storage | 49 // in the |active_paths|, or in use by current entries in the storage |
| 50 // partition. | 50 // partition. |
| 51 // | 51 // |
| 52 // The |done| closure is executed on the calling thread when garbage | 52 // The |done| closure is executed on the calling thread when garbage |
| 53 // collection is complete. | 53 // collection is complete. |
| 54 void GarbageCollect(scoped_ptr<base::hash_set<base::FilePath> > active_paths, | 54 void GarbageCollect( |
| 55 const base::Closure& done); | 55 std::unique_ptr<base::hash_set<base::FilePath>> active_paths, |
| 56 const base::Closure& done); |
| 56 | 57 |
| 57 void ForEach(const BrowserContext::StoragePartitionCallback& callback); | 58 void ForEach(const BrowserContext::StoragePartitionCallback& callback); |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 FRIEND_TEST_ALL_PREFIXES(StoragePartitionConfigTest, OperatorLess); | 61 FRIEND_TEST_ALL_PREFIXES(StoragePartitionConfigTest, OperatorLess); |
| 61 FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplMapTest, GarbageCollect); | 62 FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplMapTest, GarbageCollect); |
| 62 | 63 |
| 63 // Each StoragePartition is uniquely identified by which partition domain | 64 // Each StoragePartition is uniquely identified by which partition domain |
| 64 // it belongs to (such as an app or the browser itself), the user supplied | 65 // it belongs to (such as an app or the browser itself), the user supplied |
| 65 // partition name and the bit indicating whether it should be persisted on | 66 // partition name and the bit indicating whether it should be persisted on |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 PartitionMap partitions_; | 126 PartitionMap partitions_; |
| 126 | 127 |
| 127 // Set to true when the ResourceContext for the associated |browser_context_| | 128 // Set to true when the ResourceContext for the associated |browser_context_| |
| 128 // is initialized. Can never return to false. | 129 // is initialized. Can never return to false. |
| 129 bool resource_context_initialized_; | 130 bool resource_context_initialized_; |
| 130 }; | 131 }; |
| 131 | 132 |
| 132 } // namespace content | 133 } // namespace content |
| 133 | 134 |
| 134 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_MAP_H_ | 135 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_MAP_H_ |
| OLD | NEW |