Chromium Code Reviews| Index: chrome/browser/browsing_data_remover.h |
| diff --git a/chrome/browser/browsing_data_remover.h b/chrome/browser/browsing_data_remover.h |
| index 9f940246b817b744e8b423ebcf4937d18ee5c30d..b4f8ed65c59c69406ae7e520af2128997e2073ed 100644 |
| --- a/chrome/browser/browsing_data_remover.h |
| +++ b/chrome/browser/browsing_data_remover.h |
| @@ -16,6 +16,7 @@ |
| #include "content/browser/cancelable_request.h" |
| #include "content/common/notification_observer.h" |
| #include "content/common/notification_registrar.h" |
| +#include "webkit/quota/quota_types.h" |
| class ExtensionSpecialStoragePolicy; |
| class IOThread; |
| @@ -34,6 +35,10 @@ namespace webkit_database { |
| class DatabaseTracker; |
| } |
| +namespace quota { |
| +class QuotaManager; |
| +} |
| + |
| // BrowsingDataRemover is responsible for removing data related to browsing: |
| // visits in url database, downloads, cookies ... |
| @@ -143,6 +148,32 @@ class BrowsingDataRemover : public NotificationObserver, |
| // Performs the actual work to delete the cache. |
| void DoClearCache(int rv); |
| + // Callback responding to deletion of a single quota managed origin's |
| + // temporary data |
|
jochen (gone - plz use gerrit)
2011/07/26 08:55:33
dot at end of comment
Mike West
2011/07/26 12:08:32
Done.
|
| + void OnTemporaryQuotaManagedOriginDeletion(quota::QuotaStatusCode); |
| + |
| + // Callback to respond to QuotaManager::GetOriginsModifiedSince, which is the |
| + // core of `ClearQuotaManagedDataOnIOThread` |
|
jochen (gone - plz use gerrit)
2011/07/26 08:55:33
please use regular quotes (")
Mike West
2011/07/26 12:08:32
Done.
|
| + void OnGotTemporaryQuotaManagedOrigins(const std::set<GURL>&); |
| + |
| + // Callback responding to deletion of a single quota managed origin's |
| + // persistent data |
| + void OnPersistentQuotaManagedOriginDeletion(quota::QuotaStatusCode); |
| + |
| + // Callback to respond to QuotaManager::GetOriginsModifiedSince, which is the |
| + // core of `ClearQuotaManagedDataOnIOThread` |
| + void OnGotPersistentQuotaManagedOrigins(const std::set<GURL>&); |
| + |
| + // Called to check whether all temporary and persistent origin data that |
| + // should be deleted has been deleted. If everything's good to go, invokes |
| + // NotifyAndDeleteIfDone on the UI thread. |
| + void CheckTemporaryQuotaManagedDataDeletionStatus(); |
| + void CheckPersistentQuotaManagedDataDeletionStatus(); |
| + |
| + // Invoked on the IO thread to delete all storage types managed by the quota |
| + // system: AppCache, Databases, FileSystems. |
| + void ClearQuotaManagedDataOnIOThread(); |
| + |
| // Callback when HTML5 databases have been deleted. Invokes |
| // NotifyAndDeleteIfDone. |
| void OnClearedDatabases(int rv); |
| @@ -157,17 +188,6 @@ class BrowsingDataRemover : public NotificationObserver, |
| // Invoked on the FILE thread to delete HTML5 file systems. |
| void ClearFileSystemsOnFILEThread(); |
| - // Callback when the appcache has been cleared. Invokes |
| - // NotifyAndDeleteIfDone. |
| - void OnClearedAppCache(); |
| - |
| - // Invoked on the IO thread to delete from the AppCache. |
| - void ClearAppCacheOnIOThread(); |
| - |
| - // Lower level helpers. |
| - void OnGotAppCacheInfo(int rv); |
| - void OnAppCacheDeleted(int rv); |
| - |
| // Callback when Gears data has been deleted. Invokes NotifyAndDeleteIfDone. |
| void OnClearedGearsData(); |
| @@ -181,10 +201,11 @@ class BrowsingDataRemover : public NotificationObserver, |
| bool all_done() { |
| return registrar_.IsEmpty() && !waiting_for_clear_cache_ && |
| !waiting_for_clear_history_ && |
| + !waiting_for_clear_temporary_quota_managed_data_ && |
| + !waiting_for_clear_persistent_quota_managed_data_ && |
| !waiting_for_clear_networking_history_ && |
| - !waiting_for_clear_databases_ && !waiting_for_clear_appcache_ && |
| !waiting_for_clear_lso_data_ && !waiting_for_clear_gears_data_ && |
| - !waiting_for_clear_file_systems_; |
| + !waiting_for_clear_databases_; |
| } |
| NotificationRegistrar registrar_; |
| @@ -192,6 +213,10 @@ class BrowsingDataRemover : public NotificationObserver, |
| // Profile we're to remove from. |
| Profile* profile_; |
| + // the QuotaManager is owned by the profile; we can use a raw pointer here, |
| + // and rely on the profile to destroy the object whenever it's reasonable. |
| + quota::QuotaManager* quota_manager_; |
| + |
| // 'Protected' origins are not subject to data removal. |
| scoped_refptr<ExtensionSpecialStoragePolicy> special_storage_policy_; |
| @@ -210,18 +235,11 @@ class BrowsingDataRemover : public NotificationObserver, |
| net::CompletionCallbackImpl<BrowsingDataRemover> database_cleared_callback_; |
| net::CompletionCallbackImpl<BrowsingDataRemover> cache_callback_; |
| - // Used to clear the appcache. |
| - scoped_refptr<ChromeAppCacheService> appcache_service_; |
| - net::CompletionCallbackImpl<BrowsingDataRemover> appcache_got_info_callback_; |
| - net::CompletionCallbackImpl<BrowsingDataRemover> appcache_deleted_callback_; |
| - scoped_refptr<appcache::AppCacheInfoCollection> appcache_info_; |
| - int appcaches_to_be_deleted_count_; |
| - |
| // Used to delete data from the HTTP caches. |
| CacheState next_cache_state_; |
| disk_cache::Backend* cache_; |
| - // Used to delete data from HTTP cache and appcache. |
| + // Used to delete data from HTTP cache. |
| scoped_refptr<net::URLRequestContextGetter> main_context_getter_; |
| scoped_refptr<net::URLRequestContextGetter> media_context_getter_; |
| @@ -232,12 +250,16 @@ class BrowsingDataRemover : public NotificationObserver, |
| // True if we're waiting for various data to be deleted. |
| bool waiting_for_clear_databases_; |
| bool waiting_for_clear_history_; |
| + bool waiting_for_clear_temporary_quota_managed_data_; |
| + bool waiting_for_clear_persistent_quota_managed_data_; |
| bool waiting_for_clear_networking_history_; |
| bool waiting_for_clear_cache_; |
| - bool waiting_for_clear_appcache_; |
| bool waiting_for_clear_lso_data_; |
| bool waiting_for_clear_gears_data_; |
| - bool waiting_for_clear_file_systems_; |
| + |
| + // Tracking how many origins need to be deleted. |
| + int temporary_quota_origins_to_delete_count_; |
| + int persistent_quota_origins_to_delete_count_; |
| ObserverList<Observer> observer_list_; |