| OLD | NEW |
| 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 CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "base/prefs/pref_member.h" | 13 #include "base/prefs/pref_member.h" |
| 14 #include "base/sequenced_task_runner_helpers.h" | 14 #include "base/sequenced_task_runner_helpers.h" |
| 15 #include "base/synchronization/waitable_event_watcher.h" | 15 #include "base/synchronization/waitable_event_watcher.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "chrome/browser/pepper_flash_settings_manager.h" | 17 #include "chrome/browser/pepper_flash_settings_manager.h" |
| 18 #include "chrome/common/cancelable_task_tracker.h" | 18 #include "chrome/common/cancelable_task_tracker.h" |
| 19 #include "content/public/browser/dom_storage_context.h" | |
| 20 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
| 21 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 22 #include "url/gurl.h" | 21 #include "url/gurl.h" |
| 23 #include "webkit/common/quota/quota_types.h" | 22 #include "webkit/common/quota/quota_types.h" |
| 24 | 23 |
| 25 class ExtensionSpecialStoragePolicy; | 24 class ExtensionSpecialStoragePolicy; |
| 26 class IOThread; | 25 class IOThread; |
| 27 class Profile; | 26 class Profile; |
| 28 | 27 |
| 29 namespace content { | 28 namespace content { |
| 30 class PluginDataRemover; | 29 class PluginDataRemover; |
| 31 } | 30 } |
| 32 | 31 |
| 33 namespace disk_cache { | 32 namespace disk_cache { |
| 34 class Backend; | 33 class Backend; |
| 35 } | 34 } |
| 36 | 35 |
| 37 namespace net { | 36 namespace net { |
| 38 class URLRequestContextGetter; | 37 class URLRequestContextGetter; |
| 39 } | 38 } |
| 40 | 39 |
| 41 namespace quota { | 40 namespace quota { |
| 42 class QuotaManager; | 41 class QuotaManager; |
| 43 } | 42 } |
| 44 | 43 |
| 45 namespace dom_storage { | 44 namespace content { |
| 45 class DOMStorageContext; |
| 46 struct LocalStorageUsageInfo; | 46 struct LocalStorageUsageInfo; |
| 47 struct SessionStorageUsageInfo; | 47 struct SessionStorageUsageInfo; |
| 48 } | 48 } |
| 49 | 49 |
| 50 // BrowsingDataRemover is responsible for removing data related to browsing: | 50 // BrowsingDataRemover is responsible for removing data related to browsing: |
| 51 // visits in url database, downloads, cookies ... | 51 // visits in url database, downloads, cookies ... |
| 52 | 52 |
| 53 class BrowsingDataRemover : public content::NotificationObserver | 53 class BrowsingDataRemover : public content::NotificationObserver |
| 54 #if defined(ENABLE_PLUGINS) | 54 #if defined(ENABLE_PLUGINS) |
| 55 , public PepperFlashSettingsManager::Client | 55 , public PepperFlashSettingsManager::Client |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 288 |
| 289 // Invoked on the IO thread to delete the NaCl cache. | 289 // Invoked on the IO thread to delete the NaCl cache. |
| 290 void ClearNaClCacheOnIOThread(); | 290 void ClearNaClCacheOnIOThread(); |
| 291 #endif | 291 #endif |
| 292 | 292 |
| 293 // Invoked on the UI thread to delete local storage. | 293 // Invoked on the UI thread to delete local storage. |
| 294 void ClearLocalStorageOnUIThread(); | 294 void ClearLocalStorageOnUIThread(); |
| 295 | 295 |
| 296 // Callback to deal with the list gathered in ClearLocalStorageOnUIThread. | 296 // Callback to deal with the list gathered in ClearLocalStorageOnUIThread. |
| 297 void OnGotLocalStorageUsageInfo( | 297 void OnGotLocalStorageUsageInfo( |
| 298 const std::vector<dom_storage::LocalStorageUsageInfo>& infos); | 298 const std::vector<content::LocalStorageUsageInfo>& infos); |
| 299 | 299 |
| 300 // Invoked on the UI thread to delete session storage. | 300 // Invoked on the UI thread to delete session storage. |
| 301 void ClearSessionStorageOnUIThread(); | 301 void ClearSessionStorageOnUIThread(); |
| 302 | 302 |
| 303 // Callback to deal with the list gathered in ClearSessionStorageOnUIThread. | 303 // Callback to deal with the list gathered in ClearSessionStorageOnUIThread. |
| 304 void OnGotSessionStorageUsageInfo( | 304 void OnGotSessionStorageUsageInfo( |
| 305 const std::vector<dom_storage::SessionStorageUsageInfo>& infos); | 305 const std::vector<content::SessionStorageUsageInfo>& infos); |
| 306 | 306 |
| 307 // Invoked on the IO thread to delete all storage types managed by the quota | 307 // Invoked on the IO thread to delete all storage types managed by the quota |
| 308 // system: AppCache, Databases, FileSystems. | 308 // system: AppCache, Databases, FileSystems. |
| 309 void ClearQuotaManagedDataOnIOThread(); | 309 void ClearQuotaManagedDataOnIOThread(); |
| 310 | 310 |
| 311 // Callback to respond to QuotaManager::GetOriginsModifiedSince, which is the | 311 // Callback to respond to QuotaManager::GetOriginsModifiedSince, which is the |
| 312 // core of 'ClearQuotaManagedDataOnIOThread'. | 312 // core of 'ClearQuotaManagedDataOnIOThread'. |
| 313 void OnGotQuotaManagedOrigins(const std::set<GURL>& origins, | 313 void OnGotQuotaManagedOrigins(const std::set<GURL>& origins, |
| 314 quota::StorageType type); | 314 quota::StorageType type); |
| 315 | 315 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 | 442 |
| 443 ObserverList<Observer> observer_list_; | 443 ObserverList<Observer> observer_list_; |
| 444 | 444 |
| 445 // Used if we need to clear history. | 445 // Used if we need to clear history. |
| 446 CancelableTaskTracker history_task_tracker_; | 446 CancelableTaskTracker history_task_tracker_; |
| 447 | 447 |
| 448 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 448 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
| 449 }; | 449 }; |
| 450 | 450 |
| 451 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 451 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| OLD | NEW |