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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 REMOVE_DOWNLOADS = 1 << 3, | 80 REMOVE_DOWNLOADS = 1 << 3, |
81 REMOVE_FILE_SYSTEMS = 1 << 4, | 81 REMOVE_FILE_SYSTEMS = 1 << 4, |
82 REMOVE_FORM_DATA = 1 << 5, | 82 REMOVE_FORM_DATA = 1 << 5, |
83 // In addition to visits, REMOVE_HISTORY removes keywords and last session. | 83 // In addition to visits, REMOVE_HISTORY removes keywords and last session. |
84 REMOVE_HISTORY = 1 << 6, | 84 REMOVE_HISTORY = 1 << 6, |
85 REMOVE_INDEXEDDB = 1 << 7, | 85 REMOVE_INDEXEDDB = 1 << 7, |
86 REMOVE_LOCAL_STORAGE = 1 << 8, | 86 REMOVE_LOCAL_STORAGE = 1 << 8, |
87 REMOVE_PLUGIN_DATA = 1 << 9, | 87 REMOVE_PLUGIN_DATA = 1 << 9, |
88 REMOVE_PASSWORDS = 1 << 10, | 88 REMOVE_PASSWORDS = 1 << 10, |
89 REMOVE_WEBSQL = 1 << 11, | 89 REMOVE_WEBSQL = 1 << 11, |
90 REMOVE_SERVER_BOUND_CERTS = 1 << 12, | 90 REMOVE_CHANNEL_IDS = 1 << 12, |
91 REMOVE_CONTENT_LICENSES = 1 << 13, | 91 REMOVE_CONTENT_LICENSES = 1 << 13, |
92 #if defined(OS_ANDROID) | 92 #if defined(OS_ANDROID) |
93 REMOVE_APP_BANNER_DATA = 1 << 14, | 93 REMOVE_APP_BANNER_DATA = 1 << 14, |
94 #endif | 94 #endif |
95 // The following flag is used only in tests. In normal usage, hosted app | 95 // The following flag is used only in tests. In normal usage, hosted app |
96 // data is controlled by the REMOVE_COOKIES flag, applied to the | 96 // data is controlled by the REMOVE_COOKIES flag, applied to the |
97 // protected-web origin. | 97 // protected-web origin. |
98 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31, | 98 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31, |
99 | 99 |
100 // "Site data" includes cookies, appcache, file systems, indexedDBs, local | 100 // "Site data" includes cookies, appcache, file systems, indexedDBs, local |
101 // storage, webSQL, and plugin data. | 101 // storage, webSQL, and plugin data. |
102 REMOVE_SITE_DATA = REMOVE_APPCACHE | | 102 REMOVE_SITE_DATA = REMOVE_APPCACHE | |
103 REMOVE_COOKIES | | 103 REMOVE_COOKIES | |
104 REMOVE_FILE_SYSTEMS | | 104 REMOVE_FILE_SYSTEMS | |
105 REMOVE_INDEXEDDB | | 105 REMOVE_INDEXEDDB | |
106 REMOVE_LOCAL_STORAGE | | 106 REMOVE_LOCAL_STORAGE | |
107 REMOVE_PLUGIN_DATA | | 107 REMOVE_PLUGIN_DATA | |
108 REMOVE_WEBSQL | | 108 REMOVE_WEBSQL | |
109 #if defined(OS_ANDROID) | 109 #if defined(OS_ANDROID) |
110 REMOVE_APP_BANNER_DATA | | 110 REMOVE_APP_BANNER_DATA | |
111 #endif | 111 #endif |
112 REMOVE_SERVER_BOUND_CERTS, | 112 REMOVE_CHANNEL_IDS, |
113 | 113 |
114 // 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 |
115 // 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 |
116 // look like a new Profile. | 116 // look like a new Profile. |
117 REMOVE_ALL = REMOVE_SITE_DATA | | 117 REMOVE_ALL = REMOVE_SITE_DATA | |
118 REMOVE_CACHE | | 118 REMOVE_CACHE | |
119 REMOVE_DOWNLOADS | | 119 REMOVE_DOWNLOADS | |
120 REMOVE_FORM_DATA | | 120 REMOVE_FORM_DATA | |
121 REMOVE_HISTORY | | 121 REMOVE_HISTORY | |
122 REMOVE_PASSWORDS | | 122 REMOVE_PASSWORDS | |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 // Invoked on the IO thread to delete entries in the PNaCl translation cache. | 345 // Invoked on the IO thread to delete entries in the PNaCl translation cache. |
346 void ClearPnaclCacheOnIOThread(base::Time begin, base::Time end); | 346 void ClearPnaclCacheOnIOThread(base::Time begin, base::Time end); |
347 #endif | 347 #endif |
348 | 348 |
349 // Callback for when Cookies has been deleted. Invokes NotifyAndDeleteIfDone. | 349 // Callback for when Cookies has been deleted. Invokes NotifyAndDeleteIfDone. |
350 void OnClearedCookies(int num_deleted); | 350 void OnClearedCookies(int num_deleted); |
351 | 351 |
352 // Invoked on the IO thread to delete cookies. | 352 // Invoked on the IO thread to delete cookies. |
353 void ClearCookiesOnIOThread(net::URLRequestContextGetter* rq_context); | 353 void ClearCookiesOnIOThread(net::URLRequestContextGetter* rq_context); |
354 | 354 |
355 // Invoked on the IO thread to delete server bound certs. | 355 // Invoked on the IO thread to delete channel IDs. |
356 void ClearServerBoundCertsOnIOThread( | 356 void ClearChannelIDsOnIOThread( |
357 net::URLRequestContextGetter* rq_context); | 357 net::URLRequestContextGetter* rq_context); |
358 | 358 |
359 // Callback on IO Thread when server bound certs have been deleted. Clears SSL | 359 // Callback on IO Thread when channel IDs have been deleted. Clears SSL |
360 // connection pool and posts to UI thread to run OnClearedServerBoundCerts. | 360 // connection pool and posts to UI thread to run OnClearedChannelIDs. |
361 void OnClearedServerBoundCertsOnIOThread( | 361 void OnClearedChannelIDsOnIOThread( |
362 net::URLRequestContextGetter* rq_context); | 362 net::URLRequestContextGetter* rq_context); |
363 | 363 |
364 // Callback for when server bound certs have been deleted. Invokes | 364 // Callback for when channel IDs have been deleted. Invokes |
365 // NotifyAndDeleteIfDone. | 365 // NotifyAndDeleteIfDone. |
366 void OnClearedServerBoundCerts(); | 366 void OnClearedChannelIDs(); |
367 | 367 |
368 // Callback from the above method. | 368 // Callback from the above method. |
369 void OnClearedFormData(); | 369 void OnClearedFormData(); |
370 | 370 |
371 // Callback for when the Autofill profile and credit card origin URLs have | 371 // Callback for when the Autofill profile and credit card origin URLs have |
372 // been deleted. | 372 // been deleted. |
373 void OnClearedAutofillOriginURLs(); | 373 void OnClearedAutofillOriginURLs(); |
374 | 374 |
375 // Callback on UI thread when the storage partition related data are cleared. | 375 // Callback on UI thread when the storage partition related data are cleared. |
376 void OnClearedStoragePartitionData(); | 376 void OnClearedStoragePartitionData(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 419 |
420 // Used to deauthorize content licenses for Pepper Flash. | 420 // Used to deauthorize content licenses for Pepper Flash. |
421 scoped_ptr<PepperFlashSettingsManager> pepper_flash_settings_manager_; | 421 scoped_ptr<PepperFlashSettingsManager> pepper_flash_settings_manager_; |
422 #endif | 422 #endif |
423 | 423 |
424 uint32 deauthorize_content_licenses_request_id_; | 424 uint32 deauthorize_content_licenses_request_id_; |
425 // True if we're waiting for various data to be deleted. | 425 // True if we're waiting for various data to be deleted. |
426 // These may only be accessed from UI thread in order to avoid races! | 426 // These may only be accessed from UI thread in order to avoid races! |
427 bool waiting_for_clear_autofill_origin_urls_; | 427 bool waiting_for_clear_autofill_origin_urls_; |
428 bool waiting_for_clear_cache_; | 428 bool waiting_for_clear_cache_; |
| 429 bool waiting_for_clear_channel_ids_; |
429 bool waiting_for_clear_content_licenses_; | 430 bool waiting_for_clear_content_licenses_; |
430 // Non-zero if waiting for cookies to be cleared. | 431 // Non-zero if waiting for cookies to be cleared. |
431 int waiting_for_clear_cookies_count_; | 432 int waiting_for_clear_cookies_count_; |
432 bool waiting_for_clear_domain_reliability_monitor_; | 433 bool waiting_for_clear_domain_reliability_monitor_; |
433 bool waiting_for_clear_form_; | 434 bool waiting_for_clear_form_; |
434 bool waiting_for_clear_history_; | 435 bool waiting_for_clear_history_; |
435 bool waiting_for_clear_hostname_resolution_cache_; | 436 bool waiting_for_clear_hostname_resolution_cache_; |
436 bool waiting_for_clear_keyword_data_; | 437 bool waiting_for_clear_keyword_data_; |
437 bool waiting_for_clear_logged_in_predictor_; | 438 bool waiting_for_clear_logged_in_predictor_; |
438 bool waiting_for_clear_nacl_cache_; | 439 bool waiting_for_clear_nacl_cache_; |
439 bool waiting_for_clear_network_predictor_; | 440 bool waiting_for_clear_network_predictor_; |
440 bool waiting_for_clear_networking_history_; | 441 bool waiting_for_clear_networking_history_; |
441 bool waiting_for_clear_platform_keys_; | 442 bool waiting_for_clear_platform_keys_; |
442 bool waiting_for_clear_plugin_data_; | 443 bool waiting_for_clear_plugin_data_; |
443 bool waiting_for_clear_pnacl_cache_; | 444 bool waiting_for_clear_pnacl_cache_; |
444 bool waiting_for_clear_server_bound_certs_; | |
445 bool waiting_for_clear_storage_partition_data_; | 445 bool waiting_for_clear_storage_partition_data_; |
446 #if defined(ENABLE_WEBRTC) | 446 #if defined(ENABLE_WEBRTC) |
447 bool waiting_for_clear_webrtc_logs_; | 447 bool waiting_for_clear_webrtc_logs_; |
448 #endif | 448 #endif |
449 | 449 |
450 // The removal mask for the current removal operation. | 450 // The removal mask for the current removal operation. |
451 int remove_mask_; | 451 int remove_mask_; |
452 | 452 |
453 // The origin for the current removal operation. | 453 // The origin for the current removal operation. |
454 GURL remove_origin_; | 454 GURL remove_origin_; |
455 | 455 |
456 // From which types of origins should we remove data? | 456 // From which types of origins should we remove data? |
457 int origin_set_mask_; | 457 int origin_set_mask_; |
458 | 458 |
459 ObserverList<Observer> observer_list_; | 459 ObserverList<Observer> observer_list_; |
460 | 460 |
461 // Used if we need to clear history. | 461 // Used if we need to clear history. |
462 base::CancelableTaskTracker history_task_tracker_; | 462 base::CancelableTaskTracker history_task_tracker_; |
463 | 463 |
464 scoped_ptr<TemplateURLService::Subscription> template_url_sub_; | 464 scoped_ptr<TemplateURLService::Subscription> template_url_sub_; |
465 | 465 |
466 // We do not own this. | 466 // We do not own this. |
467 content::StoragePartition* storage_partition_for_testing_; | 467 content::StoragePartition* storage_partition_for_testing_; |
468 | 468 |
469 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 469 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
470 }; | 470 }; |
471 | 471 |
472 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 472 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
OLD | NEW |