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 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 delete_end_(delete_end), | 182 delete_end_(delete_end), |
183 next_cache_state_(STATE_NONE), | 183 next_cache_state_(STATE_NONE), |
184 cache_(NULL), | 184 cache_(NULL), |
185 main_context_getter_(profile->GetRequestContext()), | 185 main_context_getter_(profile->GetRequestContext()), |
186 media_context_getter_(profile->GetMediaRequestContext()), | 186 media_context_getter_(profile->GetMediaRequestContext()), |
187 deauthorize_content_licenses_request_id_(0), | 187 deauthorize_content_licenses_request_id_(0), |
188 waiting_for_clear_autofill_origin_urls_(false), | 188 waiting_for_clear_autofill_origin_urls_(false), |
189 waiting_for_clear_cache_(false), | 189 waiting_for_clear_cache_(false), |
190 waiting_for_clear_content_licenses_(false), | 190 waiting_for_clear_content_licenses_(false), |
191 waiting_for_clear_cookies_count_(0), | 191 waiting_for_clear_cookies_count_(0), |
| 192 waiting_for_clear_domain_reliability_monitor_(false), |
192 waiting_for_clear_form_(false), | 193 waiting_for_clear_form_(false), |
193 waiting_for_clear_history_(false), | 194 waiting_for_clear_history_(false), |
194 waiting_for_clear_hostname_resolution_cache_(false), | 195 waiting_for_clear_hostname_resolution_cache_(false), |
195 waiting_for_clear_keyword_data_(false), | 196 waiting_for_clear_keyword_data_(false), |
196 waiting_for_clear_logged_in_predictor_(false), | 197 waiting_for_clear_logged_in_predictor_(false), |
197 waiting_for_clear_nacl_cache_(false), | 198 waiting_for_clear_nacl_cache_(false), |
198 waiting_for_clear_network_predictor_(false), | 199 waiting_for_clear_network_predictor_(false), |
199 waiting_for_clear_networking_history_(false), | 200 waiting_for_clear_networking_history_(false), |
200 waiting_for_clear_platform_keys_(false), | 201 waiting_for_clear_platform_keys_(false), |
201 waiting_for_clear_plugin_data_(false), | 202 waiting_for_clear_plugin_data_(false), |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 } | 663 } |
663 #endif | 664 #endif |
664 | 665 |
665 // Always wipe accumulated network related data (TransportSecurityState and | 666 // Always wipe accumulated network related data (TransportSecurityState and |
666 // HttpServerPropertiesManager data). | 667 // HttpServerPropertiesManager data). |
667 waiting_for_clear_networking_history_ = true; | 668 waiting_for_clear_networking_history_ = true; |
668 profile_->ClearNetworkingHistorySince( | 669 profile_->ClearNetworkingHistorySince( |
669 delete_begin_, | 670 delete_begin_, |
670 base::Bind(&BrowsingDataRemover::OnClearedNetworkingHistory, | 671 base::Bind(&BrowsingDataRemover::OnClearedNetworkingHistory, |
671 base::Unretained(this))); | 672 base::Unretained(this))); |
| 673 |
| 674 if (remove_mask & (REMOVE_COOKIES | REMOVE_HISTORY)) { |
| 675 waiting_for_clear_domain_reliability_monitor_ = true; |
| 676 bool clear_contexts = !!(remove_mask & REMOVE_COOKIES); |
| 677 profile_->ClearDomainReliabilityMonitor( |
| 678 clear_contexts, |
| 679 base::Bind(&BrowsingDataRemover::OnClearedDomainReliabilityMonitor, |
| 680 base::Unretained(this))); |
| 681 } |
672 } | 682 } |
673 | 683 |
674 void BrowsingDataRemover::AddObserver(Observer* observer) { | 684 void BrowsingDataRemover::AddObserver(Observer* observer) { |
675 observer_list_.AddObserver(observer); | 685 observer_list_.AddObserver(observer); |
676 } | 686 } |
677 | 687 |
678 void BrowsingDataRemover::RemoveObserver(Observer* observer) { | 688 void BrowsingDataRemover::RemoveObserver(Observer* observer) { |
679 observer_list_.RemoveObserver(observer); | 689 observer_list_.RemoveObserver(observer); |
680 } | 690 } |
681 | 691 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 break; | 724 break; |
715 } | 725 } |
716 return delete_begin_time - diff; | 726 return delete_begin_time - diff; |
717 } | 727 } |
718 | 728 |
719 bool BrowsingDataRemover::AllDone() { | 729 bool BrowsingDataRemover::AllDone() { |
720 return !waiting_for_clear_keyword_data_ && | 730 return !waiting_for_clear_keyword_data_ && |
721 !waiting_for_clear_autofill_origin_urls_ && | 731 !waiting_for_clear_autofill_origin_urls_ && |
722 !waiting_for_clear_cache_ && !waiting_for_clear_nacl_cache_ && | 732 !waiting_for_clear_cache_ && !waiting_for_clear_nacl_cache_ && |
723 !waiting_for_clear_cookies_count_ && !waiting_for_clear_history_ && | 733 !waiting_for_clear_cookies_count_ && !waiting_for_clear_history_ && |
| 734 !waiting_for_clear_domain_reliability_monitor_ && |
724 !waiting_for_clear_logged_in_predictor_ && | 735 !waiting_for_clear_logged_in_predictor_ && |
725 !waiting_for_clear_networking_history_ && | 736 !waiting_for_clear_networking_history_ && |
726 !waiting_for_clear_server_bound_certs_ && | 737 !waiting_for_clear_server_bound_certs_ && |
727 !waiting_for_clear_plugin_data_ && | 738 !waiting_for_clear_plugin_data_ && |
728 !waiting_for_clear_pnacl_cache_ && | 739 !waiting_for_clear_pnacl_cache_ && |
729 !waiting_for_clear_content_licenses_ && !waiting_for_clear_form_ && | 740 !waiting_for_clear_content_licenses_ && !waiting_for_clear_form_ && |
730 !waiting_for_clear_hostname_resolution_cache_ && | 741 !waiting_for_clear_hostname_resolution_cache_ && |
731 !waiting_for_clear_network_predictor_ && | 742 !waiting_for_clear_network_predictor_ && |
732 !waiting_for_clear_platform_keys_ && | 743 !waiting_for_clear_platform_keys_ && |
733 #if defined(ENABLE_WEBRTC) | 744 #if defined(ENABLE_WEBRTC) |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 NotifyAndDeleteIfDone(); | 1131 NotifyAndDeleteIfDone(); |
1121 } | 1132 } |
1122 | 1133 |
1123 #if defined(ENABLE_WEBRTC) | 1134 #if defined(ENABLE_WEBRTC) |
1124 void BrowsingDataRemover::OnClearedWebRtcLogs() { | 1135 void BrowsingDataRemover::OnClearedWebRtcLogs() { |
1125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1126 waiting_for_clear_webrtc_logs_ = false; | 1137 waiting_for_clear_webrtc_logs_ = false; |
1127 NotifyAndDeleteIfDone(); | 1138 NotifyAndDeleteIfDone(); |
1128 } | 1139 } |
1129 #endif | 1140 #endif |
| 1141 |
| 1142 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { |
| 1143 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1144 waiting_for_clear_domain_reliability_monitor_ = false; |
| 1145 NotifyAndDeleteIfDone(); |
| 1146 } |
OLD | NEW |