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

Side by Side Diff: content/public/browser/browser_context.h

Issue 11419307: Garbage Collect the Storage directory on next profile start after an extension uninstall. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Basic code done. Created 8 years 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_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/hash_tables.h" 9 #include "base/hash_tables.h"
10 #include "base/supports_user_data.h" 10 #include "base/supports_user_data.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 static content::StoragePartition* GetStoragePartition( 46 static content::StoragePartition* GetStoragePartition(
47 BrowserContext* browser_context, SiteInstance* site_instance); 47 BrowserContext* browser_context, SiteInstance* site_instance);
48 static content::StoragePartition* GetStoragePartitionForSite( 48 static content::StoragePartition* GetStoragePartitionForSite(
49 BrowserContext* browser_context, const GURL& site); 49 BrowserContext* browser_context, const GURL& site);
50 static void ForEachStoragePartition( 50 static void ForEachStoragePartition(
51 BrowserContext* browser_context, 51 BrowserContext* browser_context,
52 const StoragePartitionCallback& callback); 52 const StoragePartitionCallback& callback);
53 static void AsyncObliterateStoragePartition( 53 static void AsyncObliterateStoragePartition(
54 BrowserContext* browser_context, 54 BrowserContext* browser_context,
55 const GURL& site); 55 const GURL& site,
56 const base::Closure& on_gc_required);
57
58 // This function clears the contents of |active_paths| but does not take
59 // ownership of the pointer.
60 //
61 // TODO(ajwong): Don't hide the malloc via this API.
62 static void GarbageCollectStoragePartitions(
63 BrowserContext* browser_context,
64 base::hash_set<FilePath>* active_paths,
65 const base::Closure& done);
56 66
57 // DON'T USE THIS. GetDefaultStoragePartition() is going away. 67 // DON'T USE THIS. GetDefaultStoragePartition() is going away.
58 // Use GetStoragePartition() instead. Ask ajwong@ if you have problems. 68 // Use GetStoragePartition() instead. Ask ajwong@ if you have problems.
59 static content::StoragePartition* GetDefaultStoragePartition( 69 static content::StoragePartition* GetDefaultStoragePartition(
60 BrowserContext* browser_context); 70 BrowserContext* browser_context);
61 71
62 // Ensures that the corresponding ResourceContext is initialized. Normally the 72 // Ensures that the corresponding ResourceContext is initialized. Normally the
63 // BrowserContext initializs the corresponding getters when its objects are 73 // BrowserContext initializs the corresponding getters when its objects are
64 // created, but if the embedder wants to pass the ResourceContext to another 74 // created, but if the embedder wants to pass the ResourceContext to another
65 // thread before they use BrowserContext, they should call this to make sure 75 // thread before they use BrowserContext, they should call this to make sure
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 struct hash<content::BrowserContext*> { 153 struct hash<content::BrowserContext*> {
144 std::size_t operator()(content::BrowserContext* const& p) const { 154 std::size_t operator()(content::BrowserContext* const& p) const {
145 return reinterpret_cast<std::size_t>(p); 155 return reinterpret_cast<std::size_t>(p);
146 } 156 }
147 }; 157 };
148 158
149 } // namespace BASE_HASH_NAMESPACE 159 } // namespace BASE_HASH_NAMESPACE
150 #endif 160 #endif
151 161
152 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ 162 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698