| 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_FORM_DATA = 1 << 5, | 75 REMOVE_FORM_DATA = 1 << 5, |
| 76 // In addition to visits, REMOVE_HISTORY removes keywords and last session. | 76 // In addition to visits, REMOVE_HISTORY removes keywords and last session. |
| 77 REMOVE_HISTORY = 1 << 6, | 77 REMOVE_HISTORY = 1 << 6, |
| 78 REMOVE_INDEXEDDB = 1 << 7, | 78 REMOVE_INDEXEDDB = 1 << 7, |
| 79 REMOVE_LOCAL_STORAGE = 1 << 8, | 79 REMOVE_LOCAL_STORAGE = 1 << 8, |
| 80 REMOVE_PLUGIN_DATA = 1 << 9, | 80 REMOVE_PLUGIN_DATA = 1 << 9, |
| 81 REMOVE_PASSWORDS = 1 << 10, | 81 REMOVE_PASSWORDS = 1 << 10, |
| 82 REMOVE_WEBSQL = 1 << 11, | 82 REMOVE_WEBSQL = 1 << 11, |
| 83 REMOVE_SERVER_BOUND_CERTS = 1 << 12, | 83 REMOVE_SERVER_BOUND_CERTS = 1 << 12, |
| 84 REMOVE_CONTENT_LICENSES = 1 << 13, | 84 REMOVE_CONTENT_LICENSES = 1 << 13, |
| 85 REMOVE_SHADER_CACHE = 1 << 14, |
| 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, and plugin data. | 92 // storage, webSQL, shader, and plugin data. |
| 92 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS | | 93 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS | |
| 93 REMOVE_INDEXEDDB | REMOVE_LOCAL_STORAGE | | 94 REMOVE_INDEXEDDB | REMOVE_LOCAL_STORAGE | |
| 94 REMOVE_PLUGIN_DATA | REMOVE_WEBSQL | | 95 REMOVE_PLUGIN_DATA | REMOVE_WEBSQL | |
| 95 REMOVE_SERVER_BOUND_CERTS | 96 REMOVE_SERVER_BOUND_CERTS, |
| 97 // "cached data" includes the http cache and the shader cache. |
| 98 REMOVE_CACHED_DATA = REMOVE_CACHE | REMOVE_SHADER_CACHE |
| 96 }; | 99 }; |
| 97 | 100 |
| 98 // When BrowsingDataRemover successfully removes data, a notification of type | 101 // When BrowsingDataRemover successfully removes data, a notification of type |
| 99 // NOTIFICATION_BROWSING_DATA_REMOVED is triggered with a Details object of | 102 // NOTIFICATION_BROWSING_DATA_REMOVED is triggered with a Details object of |
| 100 // this type. | 103 // this type. |
| 101 struct NotificationDetails { | 104 struct NotificationDetails { |
| 102 NotificationDetails(); | 105 NotificationDetails(); |
| 103 NotificationDetails(const NotificationDetails& details); | 106 NotificationDetails(const NotificationDetails& details); |
| 104 NotificationDetails(base::Time removal_begin, | 107 NotificationDetails(base::Time removal_begin, |
| 105 int removal_mask, | 108 int removal_mask, |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 // NotifyAndDeleteIfDone. | 334 // NotifyAndDeleteIfDone. |
| 332 void OnClearedServerBoundCerts(); | 335 void OnClearedServerBoundCerts(); |
| 333 | 336 |
| 334 // Callback on the DB thread so that we can wait for the form data to be | 337 // Callback on the DB thread so that we can wait for the form data to be |
| 335 // cleared. | 338 // cleared. |
| 336 void FormDataDBThreadHop(); | 339 void FormDataDBThreadHop(); |
| 337 | 340 |
| 338 // Callback from the above method. | 341 // Callback from the above method. |
| 339 void OnClearedFormData(); | 342 void OnClearedFormData(); |
| 340 | 343 |
| 344 // Callback when the shader cache has been deleted. |
| 345 // Invokes NotifyAndDeleteIfDone. |
| 346 void ClearedShaderCache(); |
| 347 |
| 348 // Invoked on the IO thread to delete from the shader cache. |
| 349 void ClearShaderCacheOnUIThread(); |
| 350 |
| 341 // Returns true if we're all done. | 351 // Returns true if we're all done. |
| 342 bool AllDone(); | 352 bool AllDone(); |
| 343 | 353 |
| 344 content::NotificationRegistrar registrar_; | 354 content::NotificationRegistrar registrar_; |
| 345 | 355 |
| 346 // Profile we're to remove from. | 356 // Profile we're to remove from. |
| 347 Profile* profile_; | 357 Profile* profile_; |
| 348 | 358 |
| 349 // The QuotaManager is owned by the profile; we can use a raw pointer here, | 359 // The QuotaManager is owned by the profile; we can use a raw pointer here, |
| 350 // and rely on the profile to destroy the object whenever it's reasonable. | 360 // and rely on the profile to destroy the object whenever it's reasonable. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 bool waiting_for_clear_history_; | 402 bool waiting_for_clear_history_; |
| 393 bool waiting_for_clear_hostname_resolution_cache_; | 403 bool waiting_for_clear_hostname_resolution_cache_; |
| 394 bool waiting_for_clear_local_storage_; | 404 bool waiting_for_clear_local_storage_; |
| 395 bool waiting_for_clear_nacl_cache_; | 405 bool waiting_for_clear_nacl_cache_; |
| 396 bool waiting_for_clear_network_predictor_; | 406 bool waiting_for_clear_network_predictor_; |
| 397 bool waiting_for_clear_networking_history_; | 407 bool waiting_for_clear_networking_history_; |
| 398 bool waiting_for_clear_plugin_data_; | 408 bool waiting_for_clear_plugin_data_; |
| 399 bool waiting_for_clear_quota_managed_data_; | 409 bool waiting_for_clear_quota_managed_data_; |
| 400 bool waiting_for_clear_server_bound_certs_; | 410 bool waiting_for_clear_server_bound_certs_; |
| 401 bool waiting_for_clear_session_storage_; | 411 bool waiting_for_clear_session_storage_; |
| 412 bool waiting_for_clear_shader_cache_; |
| 402 | 413 |
| 403 // Tracking how many origins need to be deleted, and whether we're finished | 414 // Tracking how many origins need to be deleted, and whether we're finished |
| 404 // gathering origins. | 415 // gathering origins. |
| 405 int quota_managed_origins_to_delete_count_; | 416 int quota_managed_origins_to_delete_count_; |
| 406 int quota_managed_storage_types_to_delete_count_; | 417 int quota_managed_storage_types_to_delete_count_; |
| 407 | 418 |
| 408 // The removal mask for the current removal operation. | 419 // The removal mask for the current removal operation. |
| 409 int remove_mask_; | 420 int remove_mask_; |
| 410 | 421 |
| 411 // The origin for the current removal operation. | 422 // The origin for the current removal operation. |
| 412 GURL remove_origin_; | 423 GURL remove_origin_; |
| 413 | 424 |
| 414 // From which types of origins should we remove data? | 425 // From which types of origins should we remove data? |
| 415 int origin_set_mask_; | 426 int origin_set_mask_; |
| 416 | 427 |
| 417 ObserverList<Observer> observer_list_; | 428 ObserverList<Observer> observer_list_; |
| 418 | 429 |
| 419 // Used if we need to clear history. | 430 // Used if we need to clear history. |
| 420 CancelableTaskTracker history_task_tracker_; | 431 CancelableTaskTracker history_task_tracker_; |
| 421 | 432 |
| 422 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 433 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
| 423 }; | 434 }; |
| 424 | 435 |
| 425 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 436 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| OLD | NEW |