Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover.cc

Issue 1749603002: Store URLs in WebappDataStorage, and purge them when history is cleared. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add @VisibleForTesting to address test failures Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 if (!precache_manager) { 549 if (!precache_manager) {
550 waiting_for_clear_precache_history_ = true; 550 waiting_for_clear_precache_history_ = true;
551 precache_manager->ClearHistory(); 551 precache_manager->ClearHistory();
552 // The above calls are done on the UI thread but do their work on the DB 552 // The above calls are done on the UI thread but do their work on the DB
553 // thread. So wait for it. 553 // thread. So wait for it.
554 BrowserThread::PostTaskAndReply( 554 BrowserThread::PostTaskAndReply(
555 BrowserThread::DB, FROM_HERE, base::Bind(&base::DoNothing), 555 BrowserThread::DB, FROM_HERE, base::Bind(&base::DoNothing),
556 base::Bind(&BrowsingDataRemover::OnClearedPrecacheHistory, 556 base::Bind(&BrowsingDataRemover::OnClearedPrecacheHistory,
557 weak_ptr_factory_.GetWeakPtr())); 557 weak_ptr_factory_.GetWeakPtr()));
558 } 558 }
559
560 // Clear the history information (last launch time and origin URL) of any
561 // registered webapps.
562 waiting_for_clear_webapp_history_ = true;
gone 2016/03/08 22:40:39 The other clearing functions generally seem to Pos
dominickn 2016/03/09 08:18:33 I actually have no idea, I was just doing this the
gone 2016/03/10 23:27:21 Ah, in that case could you leave a comment to make
dominickn 2016/03/11 05:14:42 Done. The threading model across JNI calls is stil
563 WebappRegistry::ClearWebappHistory(
564 base::Bind(&BrowsingDataRemover::OnClearedWebappHistory,
565 weak_ptr_factory_.GetWeakPtr()));
559 #endif 566 #endif
560 567
561 data_reduction_proxy::DataReductionProxySettings* 568 data_reduction_proxy::DataReductionProxySettings*
562 data_reduction_proxy_settings = 569 data_reduction_proxy_settings =
563 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( 570 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(
564 profile_); 571 profile_);
565 // |data_reduction_proxy_settings| is null if |profile_| is off the record. 572 // |data_reduction_proxy_settings| is null if |profile_| is off the record.
566 if (data_reduction_proxy_settings) { 573 if (data_reduction_proxy_settings) {
567 data_reduction_proxy::DataReductionProxyService* 574 data_reduction_proxy::DataReductionProxyService*
568 data_reduction_proxy_service = 575 data_reduction_proxy_service =
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 !waiting_for_clear_network_predictor_ && 1006 !waiting_for_clear_network_predictor_ &&
1000 !waiting_for_clear_networking_history_ && 1007 !waiting_for_clear_networking_history_ &&
1001 !waiting_for_clear_passwords_ && 1008 !waiting_for_clear_passwords_ &&
1002 !waiting_for_clear_passwords_stats_ && 1009 !waiting_for_clear_passwords_stats_ &&
1003 !waiting_for_clear_platform_keys_ && 1010 !waiting_for_clear_platform_keys_ &&
1004 !waiting_for_clear_plugin_data_ && 1011 !waiting_for_clear_plugin_data_ &&
1005 !waiting_for_clear_pnacl_cache_ && 1012 !waiting_for_clear_pnacl_cache_ &&
1006 #if BUILDFLAG(ANDROID_JAVA_UI) 1013 #if BUILDFLAG(ANDROID_JAVA_UI)
1007 !waiting_for_clear_precache_history_ && 1014 !waiting_for_clear_precache_history_ &&
1008 !waiting_for_clear_webapp_data_ && 1015 !waiting_for_clear_webapp_data_ &&
1016 !waiting_for_clear_webapp_history_ &&
1009 !waiting_for_clear_offline_page_data_ && 1017 !waiting_for_clear_offline_page_data_ &&
1010 #endif 1018 #endif
1011 #if defined(ENABLE_WEBRTC) 1019 #if defined(ENABLE_WEBRTC)
1012 !waiting_for_clear_webrtc_logs_ && 1020 !waiting_for_clear_webrtc_logs_ &&
1013 #endif 1021 #endif
1014 !waiting_for_clear_storage_partition_data_; 1022 !waiting_for_clear_storage_partition_data_;
1015 } 1023 }
1016 1024
1017 void BrowsingDataRemover::OnKeywordsLoaded() { 1025 void BrowsingDataRemover::OnKeywordsLoaded() {
1018 // Deletes the entries from the model, and if we're not waiting on anything 1026 // Deletes the entries from the model, and if we're not waiting on anything
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 waiting_for_clear_precache_history_ = false; 1199 waiting_for_clear_precache_history_ = false;
1192 NotifyIfDone(); 1200 NotifyIfDone();
1193 } 1201 }
1194 1202
1195 void BrowsingDataRemover::OnClearedWebappData() { 1203 void BrowsingDataRemover::OnClearedWebappData() {
1196 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1204 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1197 waiting_for_clear_webapp_data_ = false; 1205 waiting_for_clear_webapp_data_ = false;
1198 NotifyIfDone(); 1206 NotifyIfDone();
1199 } 1207 }
1200 1208
1209 void BrowsingDataRemover::OnClearedWebappHistory() {
1210 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1211 waiting_for_clear_webapp_history_ = false;
1212 NotifyIfDone();
1213 }
1214
1201 void BrowsingDataRemover::OnClearedOfflinePageData() { 1215 void BrowsingDataRemover::OnClearedOfflinePageData() {
1202 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1216 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1203 waiting_for_clear_offline_page_data_ = false; 1217 waiting_for_clear_offline_page_data_ = false;
1204 NotifyIfDone(); 1218 NotifyIfDone();
1205 } 1219 }
1206 #endif 1220 #endif
1207 1221
1208 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { 1222 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() {
1209 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1223 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1210 waiting_for_clear_domain_reliability_monitor_ = false; 1224 waiting_for_clear_domain_reliability_monitor_ = false;
1211 NotifyIfDone(); 1225 NotifyIfDone();
1212 } 1226 }
1213 1227
1214 // static 1228 // static
1215 BrowsingDataRemover::CallbackSubscription 1229 BrowsingDataRemover::CallbackSubscription
1216 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( 1230 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback(
1217 const BrowsingDataRemover::Callback& callback) { 1231 const BrowsingDataRemover::Callback& callback) {
1218 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); 1232 return GetOnBrowsingDataRemovedCallbacks()->Add(callback);
1219 } 1233 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698