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

Unified Diff: content/browser/storage_partition_impl_map.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: done 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/site_instance_impl.cc ('k') | content/browser/storage_partition_impl_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/storage_partition_impl_map.h
diff --git a/content/browser/storage_partition_impl_map.h b/content/browser/storage_partition_impl_map.h
index 5c25e027f21edbcd66e51b511ced567293cb8180..196a388eaeed7ac4c211ba927988baa62f267149 100644
--- a/content/browser/storage_partition_impl_map.h
+++ b/content/browser/storage_partition_impl_map.h
@@ -10,12 +10,17 @@
#include "base/callback_forward.h"
#include "base/gtest_prod_util.h"
+#include "base/hash_tables.h"
#include "base/supports_user_data.h"
#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/browser_context.h"
class FilePath;
+namespace base {
+class SequencedTaskRunner;
+} // namespace base
+
namespace content {
class BrowserContext;
@@ -34,7 +39,20 @@ class StoragePartitionImplMap : public base::SupportsUserData::Data {
// Starts an asynchronous best-effort attempt to delete all on-disk storage
// related to |site|, avoiding any directories that are known to be in use.
- void AsyncObliterate(const GURL& site);
+ //
+ // |on_gc_required| is called if the AsyncObliterate() call was unable to
+ // fully clean the on-disk storage requiring a call to GarbageCollect() on
+ // the next browser start.
+ void AsyncObliterate(const GURL& site, const base::Closure& on_gc_required);
+
+ // Examines the on-disk storage and removes any entires that are not listed
+ // in the |active_paths|, or in use by current entries in the storage
+ // partition.
+ //
+ // The |done| closure is executed on the calling thread when garbage
+ // collection is complete.
+ void GarbageCollect(scoped_ptr<base::hash_set<FilePath> > active_paths,
+ const base::Closure& done);
void ForEach(const BrowserContext::StoragePartitionCallback& callback);
@@ -101,6 +119,7 @@ class StoragePartitionImplMap : public base::SupportsUserData::Data {
bool in_memory);
BrowserContext* browser_context_; // Not Owned.
+ scoped_refptr<base::SequencedTaskRunner> file_access_runner_;
PartitionMap partitions_;
// Set to true when the ResourceContext for the associated |browser_context_|
« no previous file with comments | « content/browser/site_instance_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