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

Side by Side Diff: content/browser/storage_partition_impl_map.h

Issue 11362268: Implement the ability to obliterate a storage partition from disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: source control is hard, let's go shopping! Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 known to be in use.
37 void AsyncObliterate(const GURL& site);
38
35 void ForEach(const BrowserContext::StoragePartitionCallback& callback); 39 void ForEach(const BrowserContext::StoragePartitionCallback& callback);
36 40
37 private: 41 private:
38 FRIEND_TEST_ALL_PREFIXES(StoragePartitionConfigTest, OperatorLess); 42 FRIEND_TEST_ALL_PREFIXES(StoragePartitionConfigTest, OperatorLess);
39 43
40 // Each StoragePartition is uniquely identified by which partition domain 44 // Each StoragePartition is uniquely identified by which partition domain
41 // it belongs to (such as an app or the browser itself), the user supplied 45 // 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 46 // 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 47 // disk or not. This structure contains those elements and is used as
44 // uniqueness key to lookup StoragePartition objects in the global map. 48 // uniqueness key to lookup StoragePartition objects in the global map.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // |partition_domain| and |partition_name|. 90 // |partition_domain| and |partition_name|.
87 static FilePath GetStoragePartitionPath(const std::string& partition_domain, 91 static FilePath GetStoragePartitionPath(const std::string& partition_domain,
88 const std::string& partition_name); 92 const std::string& partition_name);
89 93
90 // This must always be called *after* |partition| has been added to the 94 // This must always be called *after* |partition| has been added to the
91 // partitions_. 95 // partitions_.
92 // 96 //
93 // TODO(ajwong): Is there a way to make it so that Get()'s implementation 97 // 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 98 // doesn't need to be aware of this ordering? Revisit when refactoring
95 // ResourceContext and AppCache to respect storage partitions. 99 // ResourceContext and AppCache to respect storage partitions.
96 void PostCreateInitialization(StoragePartitionImpl* partition); 100 void PostCreateInitialization(StoragePartitionImpl* partition,
101 bool in_memory);
97 102
98 BrowserContext* browser_context_; // Not Owned. 103 BrowserContext* browser_context_; // Not Owned.
99 PartitionMap partitions_; 104 PartitionMap partitions_;
100 105
101 // Set to true when the ResourceContext for the associated |browser_context_| 106 // Set to true when the ResourceContext for the associated |browser_context_|
102 // is initialized. Can never return to false. 107 // is initialized. Can never return to false.
103 bool resource_context_initialized_; 108 bool resource_context_initialized_;
104 }; 109 };
105 110
106 } // namespace content 111 } // namespace content
107 112
108 #endif // CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_ 113 #endif // CONTENT_BROWSER_STORAGE_PARTITION_MAP_H_
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl.cc ('k') | content/browser/storage_partition_impl_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698