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

Unified Diff: chrome/browser/browsing_data/browsing_data_remover.cc

Issue 1966453003: Clear network state only when REMOVE_CACHE is set, not unconditionally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data/browsing_data_remover.cc
diff --git a/chrome/browser/browsing_data/browsing_data_remover.cc b/chrome/browser/browsing_data/browsing_data_remover.cc
index 97d22b77bc1641231d197ff228eb2f0161f504f7..ad8f44105d807a9e4b4646ecdb5ba84993342c6b 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover.cc
@@ -836,6 +836,14 @@ void BrowsingDataRemover::RemoveImpl(const TimeRange& time_range,
storage_partition_remove_mask |=
content::StoragePartition::REMOVE_DATA_MASK_WEBRTC_IDENTITY;
+
+ // When clearing cache, wipe accumulated network related data
+ // (TransportSecurityState and HttpServerPropertiesManager data).
+ waiting_for_clear_networking_history_ = true;
+ profile_->ClearNetworkingHistorySince(
+ delete_begin_,
+ base::Bind(&BrowsingDataRemover::OnClearedNetworkingHistory,
+ weak_ptr_factory_.GetWeakPtr()));
}
if (remove_mask & REMOVE_WEBRTC_IDENTITY) {
@@ -909,14 +917,6 @@ void BrowsingDataRemover::RemoveImpl(const TimeRange& time_range,
if ((remove_mask & (REMOVE_CACHE | REMOVE_COOKIES)))
prefs->SetString(omnibox::kZeroSuggestCachedResults, std::string());
- // Always wipe accumulated network related data (TransportSecurityState and
- // HttpServerPropertiesManager data).
- waiting_for_clear_networking_history_ = true;
- profile_->ClearNetworkingHistorySince(
- delete_begin_,
- base::Bind(&BrowsingDataRemover::OnClearedNetworkingHistory,
- weak_ptr_factory_.GetWeakPtr()));
-
if (remove_mask & (REMOVE_COOKIES | REMOVE_HISTORY)) {
domain_reliability::DomainReliabilityService* service =
domain_reliability::DomainReliabilityServiceFactory::
@@ -965,6 +965,9 @@ void BrowsingDataRemover::RemoveImpl(const TimeRange& time_range,
choice = ONLY_CACHE;
}
+ // Notify in case all actions taken were synchronous.
+ NotifyIfDone();
+
UMA_HISTOGRAM_ENUMERATION(
"History.ClearBrowsingData.UserDeletedCookieOrCache",
choice, MAX_CHOICE_VALUE);
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698