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" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 namespace dom_storage { | 45 namespace dom_storage { |
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 public base::WaitableEventWatcher::Delegate, | 54 #if defined(ENABLE_PLUGINS) |
55 public PepperFlashSettingsManager::Client { | 55 public PepperFlashSettingsManager::Client, |
| 56 #endif |
| 57 public base::WaitableEventWatcher::Delegate { |
56 public: | 58 public: |
57 // Time period ranges available when doing browsing data removals. | 59 // Time period ranges available when doing browsing data removals. |
58 enum TimePeriod { | 60 enum TimePeriod { |
59 LAST_HOUR = 0, | 61 LAST_HOUR = 0, |
60 LAST_DAY, | 62 LAST_DAY, |
61 LAST_WEEK, | 63 LAST_WEEK, |
62 FOUR_WEEKS, | 64 FOUR_WEEKS, |
63 EVERYTHING | 65 EVERYTHING |
64 }; | 66 }; |
65 | 67 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // BrowsingDataRemover. | 208 // BrowsingDataRemover. |
207 virtual void Observe(int type, | 209 virtual void Observe(int type, |
208 const content::NotificationSource& source, | 210 const content::NotificationSource& source, |
209 const content::NotificationDetails& details) OVERRIDE; | 211 const content::NotificationDetails& details) OVERRIDE; |
210 | 212 |
211 // WaitableEventWatcher implementation. | 213 // WaitableEventWatcher implementation. |
212 // Called when plug-in data has been cleared. Invokes NotifyAndDeleteIfDone. | 214 // Called when plug-in data has been cleared. Invokes NotifyAndDeleteIfDone. |
213 virtual void OnWaitableEventSignaled( | 215 virtual void OnWaitableEventSignaled( |
214 base::WaitableEvent* waitable_event) OVERRIDE; | 216 base::WaitableEvent* waitable_event) OVERRIDE; |
215 | 217 |
| 218 #if defined(ENABLE_PLUGINS) |
216 // PepperFlashSettingsManager::Client implementation. | 219 // PepperFlashSettingsManager::Client implementation. |
217 virtual void OnDeauthorizeContentLicensesCompleted(uint32 request_id, | 220 virtual void OnDeauthorizeContentLicensesCompleted(uint32 request_id, |
218 bool success) OVERRIDE; | 221 bool success) OVERRIDE; |
| 222 #endif |
219 | 223 |
220 // Removes the specified items related to browsing for a specific host. If the | 224 // Removes the specified items related to browsing for a specific host. If the |
221 // provided |origin| is empty, data is removed for all origins. The | 225 // provided |origin| is empty, data is removed for all origins. The |
222 // |origin_set_mask| parameter defines the set of origins from which data | 226 // |origin_set_mask| parameter defines the set of origins from which data |
223 // should be removed (protected, unprotected, or both). | 227 // should be removed (protected, unprotected, or both). |
224 void RemoveImpl(int remove_mask, | 228 void RemoveImpl(int remove_mask, |
225 const GURL& origin, | 229 const GURL& origin, |
226 int origin_set_mask); | 230 int origin_set_mask); |
227 | 231 |
228 // If we're not waiting on anything, notifies observers and deletes this | 232 // If we're not waiting on anything, notifies observers and deletes this |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 disk_cache::Backend* cache_; | 363 disk_cache::Backend* cache_; |
360 | 364 |
361 // Used to delete data from HTTP cache. | 365 // Used to delete data from HTTP cache. |
362 scoped_refptr<net::URLRequestContextGetter> main_context_getter_; | 366 scoped_refptr<net::URLRequestContextGetter> main_context_getter_; |
363 scoped_refptr<net::URLRequestContextGetter> media_context_getter_; | 367 scoped_refptr<net::URLRequestContextGetter> media_context_getter_; |
364 | 368 |
365 // Used to delete plugin data. | 369 // Used to delete plugin data. |
366 scoped_ptr<content::PluginDataRemover> plugin_data_remover_; | 370 scoped_ptr<content::PluginDataRemover> plugin_data_remover_; |
367 base::WaitableEventWatcher watcher_; | 371 base::WaitableEventWatcher watcher_; |
368 | 372 |
| 373 #if defined(ENABLE_PLUGINS) |
369 // Used to deauthorize content licenses for Pepper Flash. | 374 // Used to deauthorize content licenses for Pepper Flash. |
370 scoped_ptr<PepperFlashSettingsManager> pepper_flash_settings_manager_; | 375 scoped_ptr<PepperFlashSettingsManager> pepper_flash_settings_manager_; |
| 376 #endif |
| 377 |
371 uint32 deauthorize_content_licenses_request_id_; | 378 uint32 deauthorize_content_licenses_request_id_; |
372 | |
373 // True if we're waiting for various data to be deleted. | 379 // True if we're waiting for various data to be deleted. |
374 // These may only be accessed from UI thread in order to avoid races! | 380 // These may only be accessed from UI thread in order to avoid races! |
375 bool waiting_for_clear_cache_; | 381 bool waiting_for_clear_cache_; |
376 bool waiting_for_clear_content_licenses_; | 382 bool waiting_for_clear_content_licenses_; |
377 // Non-zero if waiting for cookies to be cleared. | 383 // Non-zero if waiting for cookies to be cleared. |
378 int waiting_for_clear_cookies_count_; | 384 int waiting_for_clear_cookies_count_; |
379 bool waiting_for_clear_form_; | 385 bool waiting_for_clear_form_; |
380 bool waiting_for_clear_history_; | 386 bool waiting_for_clear_history_; |
381 bool waiting_for_clear_hostname_resolution_cache_; | 387 bool waiting_for_clear_hostname_resolution_cache_; |
382 bool waiting_for_clear_local_storage_; | 388 bool waiting_for_clear_local_storage_; |
(...skipping 21 matching lines...) Expand all Loading... |
404 | 410 |
405 ObserverList<Observer> observer_list_; | 411 ObserverList<Observer> observer_list_; |
406 | 412 |
407 // Used if we need to clear history. | 413 // Used if we need to clear history. |
408 CancelableTaskTracker history_task_tracker_; | 414 CancelableTaskTracker history_task_tracker_; |
409 | 415 |
410 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 416 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
411 }; | 417 }; |
412 | 418 |
413 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 419 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
OLD | NEW |