| 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 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 5 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 #include "components/sessions/core/tab_restore_service.h" | 73 #include "components/sessions/core/tab_restore_service.h" |
| 74 #include "components/web_cache/browser/web_cache_manager.h" | 74 #include "components/web_cache/browser/web_cache_manager.h" |
| 75 #include "content/public/browser/browser_thread.h" | 75 #include "content/public/browser/browser_thread.h" |
| 76 #include "content/public/browser/download_manager.h" | 76 #include "content/public/browser/download_manager.h" |
| 77 #include "content/public/browser/notification_service.h" | 77 #include "content/public/browser/notification_service.h" |
| 78 #include "content/public/browser/plugin_data_remover.h" | 78 #include "content/public/browser/plugin_data_remover.h" |
| 79 #include "content/public/browser/ssl_host_state_delegate.h" | 79 #include "content/public/browser/ssl_host_state_delegate.h" |
| 80 #include "content/public/browser/storage_partition.h" | 80 #include "content/public/browser/storage_partition.h" |
| 81 #include "content/public/browser/user_metrics.h" | 81 #include "content/public/browser/user_metrics.h" |
| 82 #include "extensions/features/features.h" | 82 #include "extensions/features/features.h" |
| 83 #include "media/media_features.h" |
| 83 #include "net/base/net_errors.h" | 84 #include "net/base/net_errors.h" |
| 84 #include "net/cookies/cookie_store.h" | 85 #include "net/cookies/cookie_store.h" |
| 85 #include "net/http/http_network_session.h" | 86 #include "net/http/http_network_session.h" |
| 86 #include "net/http/http_transaction_factory.h" | 87 #include "net/http/http_transaction_factory.h" |
| 87 #include "net/http/transport_security_state.h" | 88 #include "net/http/transport_security_state.h" |
| 88 #include "net/ssl/channel_id_service.h" | 89 #include "net/ssl/channel_id_service.h" |
| 89 #include "net/ssl/channel_id_store.h" | 90 #include "net/ssl/channel_id_store.h" |
| 90 #include "net/url_request/url_request_context.h" | 91 #include "net/url_request/url_request_context.h" |
| 91 #include "net/url_request/url_request_context_getter.h" | 92 #include "net/url_request/url_request_context_getter.h" |
| 92 #include "ppapi/features/features.h" | 93 #include "ppapi/features/features.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 118 | 119 |
| 119 #if defined(OS_CHROMEOS) | 120 #if defined(OS_CHROMEOS) |
| 120 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 121 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 121 #include "chromeos/attestation/attestation_constants.h" | 122 #include "chromeos/attestation/attestation_constants.h" |
| 122 #include "chromeos/cryptohome/cryptohome_parameters.h" | 123 #include "chromeos/cryptohome/cryptohome_parameters.h" |
| 123 #include "chromeos/dbus/cryptohome_client.h" | 124 #include "chromeos/dbus/cryptohome_client.h" |
| 124 #include "chromeos/dbus/dbus_thread_manager.h" | 125 #include "chromeos/dbus/dbus_thread_manager.h" |
| 125 #include "components/user_manager/user.h" | 126 #include "components/user_manager/user.h" |
| 126 #endif | 127 #endif |
| 127 | 128 |
| 128 #if defined(ENABLE_WEBRTC) | 129 #if BUILDFLAG(ENABLE_WEBRTC) |
| 129 #include "chrome/browser/media/webrtc/webrtc_log_list.h" | 130 #include "chrome/browser/media/webrtc/webrtc_log_list.h" |
| 130 #include "chrome/browser/media/webrtc/webrtc_log_util.h" | 131 #include "chrome/browser/media/webrtc/webrtc_log_util.h" |
| 131 #endif | 132 #endif |
| 132 | 133 |
| 133 using base::UserMetricsAction; | 134 using base::UserMetricsAction; |
| 134 using content::BrowserContext; | 135 using content::BrowserContext; |
| 135 using content::BrowserThread; | 136 using content::BrowserThread; |
| 136 using content::DOMStorageContext; | 137 using content::DOMStorageContext; |
| 137 | 138 |
| 138 namespace { | 139 namespace { |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 BrowserThread::DB, FROM_HERE, base::Bind(&base::DoNothing), | 660 BrowserThread::DB, FROM_HERE, base::Bind(&base::DoNothing), |
| 660 base::Bind(&BrowsingDataRemover::OnClearedAutofillOriginURLs, | 661 base::Bind(&BrowsingDataRemover::OnClearedAutofillOriginURLs, |
| 661 weak_ptr_factory_.GetWeakPtr())); | 662 weak_ptr_factory_.GetWeakPtr())); |
| 662 | 663 |
| 663 autofill::PersonalDataManager* data_manager = | 664 autofill::PersonalDataManager* data_manager = |
| 664 autofill::PersonalDataManagerFactory::GetForProfile(profile_); | 665 autofill::PersonalDataManagerFactory::GetForProfile(profile_); |
| 665 if (data_manager) | 666 if (data_manager) |
| 666 data_manager->Refresh(); | 667 data_manager->Refresh(); |
| 667 } | 668 } |
| 668 | 669 |
| 669 #if defined(ENABLE_WEBRTC) | 670 #if BUILDFLAG(ENABLE_WEBRTC) |
| 670 waiting_for_clear_webrtc_logs_ = true; | 671 waiting_for_clear_webrtc_logs_ = true; |
| 671 BrowserThread::PostTaskAndReply( | 672 BrowserThread::PostTaskAndReply( |
| 672 BrowserThread::FILE, FROM_HERE, | 673 BrowserThread::FILE, FROM_HERE, |
| 673 base::Bind( | 674 base::Bind( |
| 674 &WebRtcLogUtil::DeleteOldAndRecentWebRtcLogFiles, | 675 &WebRtcLogUtil::DeleteOldAndRecentWebRtcLogFiles, |
| 675 WebRtcLogList::GetWebRtcLogDirectoryForProfile(profile_->GetPath()), | 676 WebRtcLogList::GetWebRtcLogDirectoryForProfile(profile_->GetPath()), |
| 676 delete_begin_), | 677 delete_begin_), |
| 677 base::Bind(&BrowsingDataRemover::OnClearedWebRtcLogs, | 678 base::Bind(&BrowsingDataRemover::OnClearedWebRtcLogs, |
| 678 weak_ptr_factory_.GetWeakPtr())); | 679 weak_ptr_factory_.GetWeakPtr())); |
| 679 #endif | 680 #endif |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1278 !waiting_for_clear_network_predictor_ && | 1279 !waiting_for_clear_network_predictor_ && |
| 1279 !waiting_for_clear_networking_history_ && | 1280 !waiting_for_clear_networking_history_ && |
| 1280 !waiting_for_clear_passwords_ && !waiting_for_clear_passwords_stats_ && | 1281 !waiting_for_clear_passwords_ && !waiting_for_clear_passwords_stats_ && |
| 1281 !waiting_for_clear_platform_keys_ && | 1282 !waiting_for_clear_platform_keys_ && |
| 1282 !waiting_for_clear_plugin_data_count_ && | 1283 !waiting_for_clear_plugin_data_count_ && |
| 1283 !waiting_for_clear_pnacl_cache_ && | 1284 !waiting_for_clear_pnacl_cache_ && |
| 1284 #if BUILDFLAG(ANDROID_JAVA_UI) | 1285 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 1285 !waiting_for_clear_precache_history_ && | 1286 !waiting_for_clear_precache_history_ && |
| 1286 !waiting_for_clear_offline_page_data_ && | 1287 !waiting_for_clear_offline_page_data_ && |
| 1287 #endif | 1288 #endif |
| 1288 #if defined(ENABLE_WEBRTC) | 1289 #if BUILDFLAG(ENABLE_WEBRTC) |
| 1289 !waiting_for_clear_webrtc_logs_ && | 1290 !waiting_for_clear_webrtc_logs_ && |
| 1290 #endif | 1291 #endif |
| 1291 !waiting_for_clear_storage_partition_data_ && | 1292 !waiting_for_clear_storage_partition_data_ && |
| 1292 !waiting_for_clear_auto_sign_in_; | 1293 !waiting_for_clear_auto_sign_in_; |
| 1293 } | 1294 } |
| 1294 | 1295 |
| 1295 void BrowsingDataRemover::OnKeywordsLoaded( | 1296 void BrowsingDataRemover::OnKeywordsLoaded( |
| 1296 base::Callback<bool(const GURL&)> url_filter) { | 1297 base::Callback<bool(const GURL&)> url_filter) { |
| 1297 // Deletes the entries from the model, and if we're not waiting on anything | 1298 // Deletes the entries from the model, and if we're not waiting on anything |
| 1298 // else notifies observers and deletes this BrowsingDataRemover. | 1299 // else notifies observers and deletes this BrowsingDataRemover. |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 waiting_for_clear_autofill_origin_urls_ = false; | 1520 waiting_for_clear_autofill_origin_urls_ = false; |
| 1520 NotifyIfDone(); | 1521 NotifyIfDone(); |
| 1521 } | 1522 } |
| 1522 | 1523 |
| 1523 void BrowsingDataRemover::OnClearedStoragePartitionData() { | 1524 void BrowsingDataRemover::OnClearedStoragePartitionData() { |
| 1524 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1525 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1525 waiting_for_clear_storage_partition_data_ = false; | 1526 waiting_for_clear_storage_partition_data_ = false; |
| 1526 NotifyIfDone(); | 1527 NotifyIfDone(); |
| 1527 } | 1528 } |
| 1528 | 1529 |
| 1529 #if defined(ENABLE_WEBRTC) | 1530 #if BUILDFLAG(ENABLE_WEBRTC) |
| 1530 void BrowsingDataRemover::OnClearedWebRtcLogs() { | 1531 void BrowsingDataRemover::OnClearedWebRtcLogs() { |
| 1531 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1532 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1532 waiting_for_clear_webrtc_logs_ = false; | 1533 waiting_for_clear_webrtc_logs_ = false; |
| 1533 NotifyIfDone(); | 1534 NotifyIfDone(); |
| 1534 } | 1535 } |
| 1535 #endif | 1536 #endif |
| 1536 | 1537 |
| 1537 #if BUILDFLAG(ANDROID_JAVA_UI) | 1538 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 1538 void BrowsingDataRemover::OnClearedPrecacheHistory() { | 1539 void BrowsingDataRemover::OnClearedPrecacheHistory() { |
| 1539 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1540 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1540 waiting_for_clear_precache_history_ = false; | 1541 waiting_for_clear_precache_history_ = false; |
| 1541 NotifyIfDone(); | 1542 NotifyIfDone(); |
| 1542 } | 1543 } |
| 1543 | 1544 |
| 1544 void BrowsingDataRemover::OnClearedOfflinePageData( | 1545 void BrowsingDataRemover::OnClearedOfflinePageData( |
| 1545 offline_pages::OfflinePageModel::DeletePageResult result) { | 1546 offline_pages::OfflinePageModel::DeletePageResult result) { |
| 1546 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1547 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1547 waiting_for_clear_offline_page_data_ = false; | 1548 waiting_for_clear_offline_page_data_ = false; |
| 1548 NotifyIfDone(); | 1549 NotifyIfDone(); |
| 1549 } | 1550 } |
| 1550 #endif | 1551 #endif |
| 1551 | 1552 |
| 1552 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { | 1553 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { |
| 1553 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1554 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1554 waiting_for_clear_domain_reliability_monitor_ = false; | 1555 waiting_for_clear_domain_reliability_monitor_ = false; |
| 1555 NotifyIfDone(); | 1556 NotifyIfDone(); |
| 1556 } | 1557 } |
| OLD | NEW |