Chromium Code Reviews| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 REMOVE_WEBSQL = 1 << 11, | 75 REMOVE_WEBSQL = 1 << 11, |
| 76 REMOVE_CHANNEL_IDS = 1 << 12, | 76 REMOVE_CHANNEL_IDS = 1 << 12, |
| 77 REMOVE_CONTENT_LICENSES = 1 << 13, | 77 REMOVE_CONTENT_LICENSES = 1 << 13, |
| 78 REMOVE_SERVICE_WORKERS = 1 << 14, | 78 REMOVE_SERVICE_WORKERS = 1 << 14, |
| 79 REMOVE_SITE_USAGE_DATA = 1 << 15, | 79 REMOVE_SITE_USAGE_DATA = 1 << 15, |
| 80 // REMOVE_NOCHECKS intentionally does not check if the Profile's prohibited | 80 // REMOVE_NOCHECKS intentionally does not check if the Profile's prohibited |
| 81 // from deleting history or downloads. | 81 // from deleting history or downloads. |
| 82 REMOVE_NOCHECKS = 1 << 16, | 82 REMOVE_NOCHECKS = 1 << 16, |
| 83 REMOVE_WEBRTC_IDENTITY = 1 << 17, | 83 REMOVE_WEBRTC_IDENTITY = 1 << 17, |
| 84 REMOVE_CACHE_STORAGE = 1 << 18, | 84 REMOVE_CACHE_STORAGE = 1 << 18, |
| 85 REMOVE_WEBAPP_DATA = 1 << 19, | |
|
Bernhard Bauer
2015/09/10 09:46:24
Would it make sense to only define this on Android
Lalit Maganti
2015/09/10 10:01:38
I guess it would actually. Changing the REMOVE_SIT
| |
| 85 // The following flag is used only in tests. In normal usage, hosted app | 86 // The following flag is used only in tests. In normal usage, hosted app |
| 86 // data is controlled by the REMOVE_COOKIES flag, applied to the | 87 // data is controlled by the REMOVE_COOKIES flag, applied to the |
| 87 // protected-web origin. | 88 // protected-web origin. |
| 88 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31, | 89 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31, |
| 89 | 90 |
| 90 // "Site data" includes cookies, appcache, file systems, indexedDBs, local | 91 // "Site data" includes cookies, appcache, file systems, indexedDBs, local |
| 91 // storage, webSQL, service workers, cache storage, and plugin data. | 92 // storage, webSQL, service workers, cache storage, plugin data, and webapp |
| 93 // data. | |
| 92 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS | | 94 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS | |
| 93 REMOVE_INDEXEDDB | | 95 REMOVE_INDEXEDDB | |
| 94 REMOVE_LOCAL_STORAGE | | 96 REMOVE_LOCAL_STORAGE | |
| 95 REMOVE_PLUGIN_DATA | | 97 REMOVE_PLUGIN_DATA | |
| 96 REMOVE_SERVICE_WORKERS | | 98 REMOVE_SERVICE_WORKERS | |
| 97 REMOVE_CACHE_STORAGE | | 99 REMOVE_CACHE_STORAGE | |
| 98 REMOVE_WEBSQL | | 100 REMOVE_WEBSQL | |
| 99 REMOVE_CHANNEL_IDS | | 101 REMOVE_CHANNEL_IDS | |
| 100 REMOVE_SITE_USAGE_DATA | | 102 REMOVE_SITE_USAGE_DATA | |
| 101 REMOVE_WEBRTC_IDENTITY, | 103 REMOVE_WEBRTC_IDENTITY | |
| 104 REMOVE_WEBAPP_DATA, | |
| 102 | 105 |
| 103 // Includes all the available remove options. Meant to be used by clients | 106 // Includes all the available remove options. Meant to be used by clients |
| 104 // that wish to wipe as much data as possible from a Profile, to make it | 107 // that wish to wipe as much data as possible from a Profile, to make it |
| 105 // look like a new Profile. | 108 // look like a new Profile. |
| 106 REMOVE_ALL = REMOVE_SITE_DATA | REMOVE_CACHE | REMOVE_DOWNLOADS | | 109 REMOVE_ALL = REMOVE_SITE_DATA | REMOVE_CACHE | REMOVE_DOWNLOADS | |
| 107 REMOVE_FORM_DATA | | 110 REMOVE_FORM_DATA | |
| 108 REMOVE_HISTORY | | 111 REMOVE_HISTORY | |
| 109 REMOVE_PASSWORDS | | 112 REMOVE_PASSWORDS | |
| 110 REMOVE_CONTENT_LICENSES, | 113 REMOVE_CONTENT_LICENSES, |
| 111 | 114 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 void OnClearedStoragePartitionData(); | 382 void OnClearedStoragePartitionData(); |
| 380 | 383 |
| 381 #if defined(ENABLE_WEBRTC) | 384 #if defined(ENABLE_WEBRTC) |
| 382 // Callback on UI thread when the WebRTC logs have been deleted. | 385 // Callback on UI thread when the WebRTC logs have been deleted. |
| 383 void OnClearedWebRtcLogs(); | 386 void OnClearedWebRtcLogs(); |
| 384 #endif | 387 #endif |
| 385 | 388 |
| 386 #if defined(OS_ANDROID) | 389 #if defined(OS_ANDROID) |
| 387 // Callback on UI thread when the precache history has been cleared. | 390 // Callback on UI thread when the precache history has been cleared. |
| 388 void OnClearedPrecacheHistory(); | 391 void OnClearedPrecacheHistory(); |
| 392 | |
| 393 // Callback on UI thread when the webapp data has been cleared. | |
| 394 void OnClearedWebappData(); | |
| 389 #endif | 395 #endif |
| 390 | 396 |
| 391 void OnClearedDomainReliabilityMonitor(); | 397 void OnClearedDomainReliabilityMonitor(); |
| 392 | 398 |
| 393 // Returns true if we're all done. | 399 // Returns true if we're all done. |
| 394 bool AllDone(); | 400 bool AllDone(); |
| 395 | 401 |
| 396 // Profile we're to remove from. | 402 // Profile we're to remove from. |
| 397 Profile* profile_; | 403 Profile* profile_; |
| 398 | 404 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 439 bool waiting_for_clear_keyword_data_ = false; | 445 bool waiting_for_clear_keyword_data_ = false; |
| 440 bool waiting_for_clear_nacl_cache_ = false; | 446 bool waiting_for_clear_nacl_cache_ = false; |
| 441 bool waiting_for_clear_network_predictor_ = false; | 447 bool waiting_for_clear_network_predictor_ = false; |
| 442 bool waiting_for_clear_networking_history_ = false; | 448 bool waiting_for_clear_networking_history_ = false; |
| 443 bool waiting_for_clear_passwords_ = false; | 449 bool waiting_for_clear_passwords_ = false; |
| 444 bool waiting_for_clear_platform_keys_ = false; | 450 bool waiting_for_clear_platform_keys_ = false; |
| 445 bool waiting_for_clear_plugin_data_ = false; | 451 bool waiting_for_clear_plugin_data_ = false; |
| 446 bool waiting_for_clear_pnacl_cache_ = false; | 452 bool waiting_for_clear_pnacl_cache_ = false; |
| 447 #if defined(OS_ANDROID) | 453 #if defined(OS_ANDROID) |
| 448 bool waiting_for_clear_precache_history_ = false; | 454 bool waiting_for_clear_precache_history_ = false; |
| 455 bool waiting_for_clear_webapp_data_ = false; | |
| 449 #endif | 456 #endif |
| 450 bool waiting_for_clear_storage_partition_data_ = false; | 457 bool waiting_for_clear_storage_partition_data_ = false; |
| 451 #if defined(ENABLE_WEBRTC) | 458 #if defined(ENABLE_WEBRTC) |
| 452 bool waiting_for_clear_webrtc_logs_ = false; | 459 bool waiting_for_clear_webrtc_logs_ = false; |
| 453 #endif | 460 #endif |
| 454 | 461 |
| 455 // The removal mask for the current removal operation. | 462 // The removal mask for the current removal operation. |
| 456 int remove_mask_ = 0; | 463 int remove_mask_ = 0; |
| 457 | 464 |
| 458 // From which types of origins should we remove data? | 465 // From which types of origins should we remove data? |
| 459 int origin_type_mask_ = 0; | 466 int origin_type_mask_ = 0; |
| 460 | 467 |
| 461 base::ObserverList<Observer> observer_list_; | 468 base::ObserverList<Observer> observer_list_; |
| 462 | 469 |
| 463 // Used if we need to clear history. | 470 // Used if we need to clear history. |
| 464 base::CancelableTaskTracker history_task_tracker_; | 471 base::CancelableTaskTracker history_task_tracker_; |
| 465 | 472 |
| 466 scoped_ptr<TemplateURLService::Subscription> template_url_sub_; | 473 scoped_ptr<TemplateURLService::Subscription> template_url_sub_; |
| 467 | 474 |
| 468 // We do not own this. | 475 // We do not own this. |
| 469 content::StoragePartition* storage_partition_for_testing_ = nullptr; | 476 content::StoragePartition* storage_partition_for_testing_ = nullptr; |
| 470 | 477 |
| 471 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 478 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
| 472 }; | 479 }; |
| 473 | 480 |
| 474 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 481 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| OLD | NEW |