| 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/task/cancelable_task_tracker.h" | 16 #include "base/task/cancelable_task_tracker.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "chrome/browser/pepper_flash_settings_manager.h" | 18 #include "chrome/browser/pepper_flash_settings_manager.h" |
| 19 #include "chrome/common/features.h" |
| 19 #include "components/search_engines/template_url_service.h" | 20 #include "components/search_engines/template_url_service.h" |
| 20 #if defined(OS_CHROMEOS) | 21 #if defined(OS_CHROMEOS) |
| 21 #include "chromeos/dbus/dbus_method_call_status.h" | 22 #include "chromeos/dbus/dbus_method_call_status.h" |
| 22 #endif | 23 #endif |
| 23 #include "storage/common/quota/quota_types.h" | 24 #include "storage/common/quota/quota_types.h" |
| 24 #include "url/gurl.h" | 25 #include "url/gurl.h" |
| 25 #include "url/origin.h" | 26 #include "url/origin.h" |
| 26 | 27 |
| 27 class IOThread; | 28 class IOThread; |
| 28 class Profile; | 29 class Profile; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 REMOVE_WEBSQL = 1 << 11, | 77 REMOVE_WEBSQL = 1 << 11, |
| 77 REMOVE_CHANNEL_IDS = 1 << 12, | 78 REMOVE_CHANNEL_IDS = 1 << 12, |
| 78 REMOVE_CONTENT_LICENSES = 1 << 13, | 79 REMOVE_CONTENT_LICENSES = 1 << 13, |
| 79 REMOVE_SERVICE_WORKERS = 1 << 14, | 80 REMOVE_SERVICE_WORKERS = 1 << 14, |
| 80 REMOVE_SITE_USAGE_DATA = 1 << 15, | 81 REMOVE_SITE_USAGE_DATA = 1 << 15, |
| 81 // REMOVE_NOCHECKS intentionally does not check if the Profile's prohibited | 82 // REMOVE_NOCHECKS intentionally does not check if the Profile's prohibited |
| 82 // from deleting history or downloads. | 83 // from deleting history or downloads. |
| 83 REMOVE_NOCHECKS = 1 << 16, | 84 REMOVE_NOCHECKS = 1 << 16, |
| 84 REMOVE_WEBRTC_IDENTITY = 1 << 17, | 85 REMOVE_WEBRTC_IDENTITY = 1 << 17, |
| 85 REMOVE_CACHE_STORAGE = 1 << 18, | 86 REMOVE_CACHE_STORAGE = 1 << 18, |
| 86 #if defined(OS_ANDROID) | 87 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 87 REMOVE_WEBAPP_DATA = 1 << 19, | 88 REMOVE_WEBAPP_DATA = 1 << 19, |
| 88 REMOVE_OFFLINE_PAGE_DATA = 1 << 20, | 89 REMOVE_OFFLINE_PAGE_DATA = 1 << 20, |
| 89 #endif | 90 #endif |
| 90 // The following flag is used only in tests. In normal usage, hosted app | 91 // The following flag is used only in tests. In normal usage, hosted app |
| 91 // data is controlled by the REMOVE_COOKIES flag, applied to the | 92 // data is controlled by the REMOVE_COOKIES flag, applied to the |
| 92 // protected-web origin. | 93 // protected-web origin. |
| 93 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31, | 94 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31, |
| 94 | 95 |
| 95 // "Site data" includes cookies, appcache, file systems, indexedDBs, local | 96 // "Site data" includes cookies, appcache, file systems, indexedDBs, local |
| 96 // storage, webSQL, service workers, cache storage, plugin data, web app | 97 // storage, webSQL, service workers, cache storage, plugin data, web app |
| 97 // data (on Android) and statistics about passwords. | 98 // data (on Android) and statistics about passwords. |
| 98 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS | | 99 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS | |
| 99 REMOVE_INDEXEDDB | | 100 REMOVE_INDEXEDDB | |
| 100 REMOVE_LOCAL_STORAGE | | 101 REMOVE_LOCAL_STORAGE | |
| 101 REMOVE_PLUGIN_DATA | | 102 REMOVE_PLUGIN_DATA | |
| 102 REMOVE_SERVICE_WORKERS | | 103 REMOVE_SERVICE_WORKERS | |
| 103 REMOVE_CACHE_STORAGE | | 104 REMOVE_CACHE_STORAGE | |
| 104 REMOVE_WEBSQL | | 105 REMOVE_WEBSQL | |
| 105 REMOVE_CHANNEL_IDS | | 106 REMOVE_CHANNEL_IDS | |
| 106 REMOVE_SITE_USAGE_DATA | | 107 REMOVE_SITE_USAGE_DATA | |
| 107 #if defined(OS_ANDROID) | 108 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 108 REMOVE_WEBAPP_DATA | | 109 REMOVE_WEBAPP_DATA | |
| 109 REMOVE_OFFLINE_PAGE_DATA | | 110 REMOVE_OFFLINE_PAGE_DATA | |
| 110 #endif | 111 #endif |
| 111 REMOVE_WEBRTC_IDENTITY, | 112 REMOVE_WEBRTC_IDENTITY, |
| 112 | 113 |
| 113 // Includes all the available remove options. Meant to be used by clients | 114 // Includes all the available remove options. Meant to be used by clients |
| 114 // that wish to wipe as much data as possible from a Profile, to make it | 115 // that wish to wipe as much data as possible from a Profile, to make it |
| 115 // look like a new Profile. | 116 // look like a new Profile. |
| 116 REMOVE_ALL = REMOVE_SITE_DATA | REMOVE_CACHE | REMOVE_DOWNLOADS | | 117 REMOVE_ALL = REMOVE_SITE_DATA | REMOVE_CACHE | REMOVE_DOWNLOADS | |
| 117 REMOVE_FORM_DATA | | 118 REMOVE_FORM_DATA | |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 void OnClearedAutofillOriginURLs(); | 391 void OnClearedAutofillOriginURLs(); |
| 391 | 392 |
| 392 // Callback on UI thread when the storage partition related data are cleared. | 393 // Callback on UI thread when the storage partition related data are cleared. |
| 393 void OnClearedStoragePartitionData(); | 394 void OnClearedStoragePartitionData(); |
| 394 | 395 |
| 395 #if defined(ENABLE_WEBRTC) | 396 #if defined(ENABLE_WEBRTC) |
| 396 // Callback on UI thread when the WebRTC logs have been deleted. | 397 // Callback on UI thread when the WebRTC logs have been deleted. |
| 397 void OnClearedWebRtcLogs(); | 398 void OnClearedWebRtcLogs(); |
| 398 #endif | 399 #endif |
| 399 | 400 |
| 400 #if defined(OS_ANDROID) | 401 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 401 // Callback on UI thread when the precache history has been cleared. | 402 // Callback on UI thread when the precache history has been cleared. |
| 402 void OnClearedPrecacheHistory(); | 403 void OnClearedPrecacheHistory(); |
| 403 | 404 |
| 404 // Callback on UI thread when the webapp data has been cleared. | 405 // Callback on UI thread when the webapp data has been cleared. |
| 405 void OnClearedWebappData(); | 406 void OnClearedWebappData(); |
| 406 | 407 |
| 407 // Callback on UI thread when the offline page data has been cleared. | 408 // Callback on UI thread when the offline page data has been cleared. |
| 408 void OnClearedOfflinePageData(); | 409 void OnClearedOfflinePageData(); |
| 409 #endif | 410 #endif |
| 410 | 411 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 bool waiting_for_clear_hostname_resolution_cache_ = false; | 459 bool waiting_for_clear_hostname_resolution_cache_ = false; |
| 459 bool waiting_for_clear_keyword_data_ = false; | 460 bool waiting_for_clear_keyword_data_ = false; |
| 460 bool waiting_for_clear_nacl_cache_ = false; | 461 bool waiting_for_clear_nacl_cache_ = false; |
| 461 bool waiting_for_clear_network_predictor_ = false; | 462 bool waiting_for_clear_network_predictor_ = false; |
| 462 bool waiting_for_clear_networking_history_ = false; | 463 bool waiting_for_clear_networking_history_ = false; |
| 463 bool waiting_for_clear_passwords_ = false; | 464 bool waiting_for_clear_passwords_ = false; |
| 464 bool waiting_for_clear_passwords_stats_ = false; | 465 bool waiting_for_clear_passwords_stats_ = false; |
| 465 bool waiting_for_clear_platform_keys_ = false; | 466 bool waiting_for_clear_platform_keys_ = false; |
| 466 bool waiting_for_clear_plugin_data_ = false; | 467 bool waiting_for_clear_plugin_data_ = false; |
| 467 bool waiting_for_clear_pnacl_cache_ = false; | 468 bool waiting_for_clear_pnacl_cache_ = false; |
| 468 #if defined(OS_ANDROID) | 469 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 469 bool waiting_for_clear_precache_history_ = false; | 470 bool waiting_for_clear_precache_history_ = false; |
| 470 bool waiting_for_clear_webapp_data_ = false; | 471 bool waiting_for_clear_webapp_data_ = false; |
| 471 bool waiting_for_clear_offline_page_data_ = false; | 472 bool waiting_for_clear_offline_page_data_ = false; |
| 472 #endif | 473 #endif |
| 473 bool waiting_for_clear_storage_partition_data_ = false; | 474 bool waiting_for_clear_storage_partition_data_ = false; |
| 474 #if defined(ENABLE_WEBRTC) | 475 #if defined(ENABLE_WEBRTC) |
| 475 bool waiting_for_clear_webrtc_logs_ = false; | 476 bool waiting_for_clear_webrtc_logs_ = false; |
| 476 #endif | 477 #endif |
| 477 | 478 |
| 478 // The removal mask for the current removal operation. | 479 // The removal mask for the current removal operation. |
| 479 int remove_mask_ = 0; | 480 int remove_mask_ = 0; |
| 480 | 481 |
| 481 // From which types of origins should we remove data? | 482 // From which types of origins should we remove data? |
| 482 int origin_type_mask_ = 0; | 483 int origin_type_mask_ = 0; |
| 483 | 484 |
| 484 base::ObserverList<Observer> observer_list_; | 485 base::ObserverList<Observer> observer_list_; |
| 485 | 486 |
| 486 // Used if we need to clear history. | 487 // Used if we need to clear history. |
| 487 base::CancelableTaskTracker history_task_tracker_; | 488 base::CancelableTaskTracker history_task_tracker_; |
| 488 | 489 |
| 489 scoped_ptr<TemplateURLService::Subscription> template_url_sub_; | 490 scoped_ptr<TemplateURLService::Subscription> template_url_sub_; |
| 490 | 491 |
| 491 // We do not own this. | 492 // We do not own this. |
| 492 content::StoragePartition* storage_partition_for_testing_ = nullptr; | 493 content::StoragePartition* storage_partition_for_testing_ = nullptr; |
| 493 | 494 |
| 494 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 495 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
| 495 }; | 496 }; |
| 496 | 497 |
| 497 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 498 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| OLD | NEW |