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

Unified Diff: chrome/browser/browsing_data_remover.h

Issue 10413072: Teaching BrowsingDataRemover how to delete application data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: How's this direction? Created 8 years, 7 months 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
Index: chrome/browser/browsing_data_remover.h
diff --git a/chrome/browser/browsing_data_remover.h b/chrome/browser/browsing_data_remover.h
index 446a7dd39280610669ed7b43c4ab4935c0056fba..e52dd7b89a6aa507c0e3843bb5f0fe29d17f0e75 100644
--- a/chrome/browser/browsing_data_remover.h
+++ b/chrome/browser/browsing_data_remover.h
@@ -122,8 +122,9 @@ class BrowsingDataRemover : public content::NotificationObserver,
BrowsingDataRemover(Profile* profile, TimePeriod time_period,
base::Time delete_end);
- // Removes the specified items related to browsing for all origins.
- void Remove(int remove_mask);
+ // Removes the specified items related to browsing for all origins that match
+ // the provided |origin_set_mask| (protected, unprotected, or both).
Bernhard Bauer 2012/05/31 15:57:31 Update the comment now there's a third bit?
Mike West 2012/06/01 13:35:17 Done.
+ void Remove(int remove_mask, int origin_set_mask);
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
@@ -186,12 +187,12 @@ class BrowsingDataRemover : public content::NotificationObserver,
bool success) OVERRIDE;
// Removes the specified items related to browsing for a specific host. If the
- // provided |origin| is empty, data is removed for all origins. If
- // |remove_protected_origins| is true, then data is removed even if the origin
- // is otherwise protected (e.g. as an installed application).
+ // provided |origin| is empty, data is removed for all origins. The
+ // |origin_set_mask| parameter defines the set of origins from which data
+ // should be removed (protected, unprotected, or both).
void RemoveImpl(int remove_mask,
const GURL& origin,
- bool remove_protected_origins);
+ int origin_set_mask);
// If we're not waiting on anything, notifies observers and deletes this
// object.
@@ -214,6 +215,15 @@ class BrowsingDataRemover : public content::NotificationObserver,
// Performs the actual work to delete the cache.
void DoClearCache(int rv);
+ // Invoked on the IO thread to delete local storage.
+ void ClearLocalStorageOnIOThread();
+
+ // Callback to deal with files gathered in ClearLocalStorageOnIOThread.
+ void OnGotLocalStorageFiles(const std::vector<FilePath>& files);
+
+ // Callback on deletion of local storage data. Invokes NotifyAndDeleteIfDone.
+ void OnLocalStorageCleared();
+
// Invoked on the IO thread to delete all storage types managed by the quota
// system: AppCache, Databases, FileSystems.
void ClearQuotaManagedDataOnIOThread();
@@ -258,6 +268,7 @@ class BrowsingDataRemover : public content::NotificationObserver,
return registrar_.IsEmpty() && !waiting_for_clear_cache_ &&
!waiting_for_clear_cookies_count_&&
!waiting_for_clear_history_ &&
+ !waiting_for_clear_local_storage_ &&
!waiting_for_clear_networking_history_ &&
!waiting_for_clear_server_bound_certs_ &&
!waiting_for_clear_plugin_data_ &&
@@ -278,6 +289,8 @@ class BrowsingDataRemover : public content::NotificationObserver,
// and rely on the profile to destroy the object whenever it's reasonable.
quota::QuotaManager* quota_manager_;
+ content::DOMStorageContext* dom_storage_context_;
Bernhard Bauer 2012/05/31 15:57:31 Can you add a comment who owns this?
Mike West 2012/06/01 13:35:17 Done.
+
// 'Protected' origins are not subject to data removal.
scoped_refptr<ExtensionSpecialStoragePolicy> special_storage_policy_;
@@ -311,6 +324,7 @@ class BrowsingDataRemover : public content::NotificationObserver,
// Non-zero if waiting for cookies to be cleared.
int waiting_for_clear_cookies_count_;
bool waiting_for_clear_history_;
+ bool waiting_for_clear_local_storage_;
bool waiting_for_clear_networking_history_;
bool waiting_for_clear_server_bound_certs_;
bool waiting_for_clear_plugin_data_;
@@ -328,8 +342,8 @@ class BrowsingDataRemover : public content::NotificationObserver,
// The origin for the current removal operation.
GURL remove_origin_;
- // Should data for protected origins be removed?
- bool remove_protected_;
+ // From which types of origins should we remove data?
+ int origin_set_mask_;
ObserverList<Observer> observer_list_;

Powered by Google App Engine
This is Rietveld 408576698