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

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

Issue 1941073002: Clear network state only when REMOVE_CACHE is set, not unconditionally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: call GetRequestContext() on main thread Created 4 years, 8 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 05e0c2ed9b5fbccdb5183b0ba7a45ce8a5c9e7be..85d7443f7a22ee32a52433fa276e354cc04d2654 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover.cc
@@ -879,6 +879,14 @@ void BrowsingDataRemover::RemoveImpl(
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) {
@@ -956,14 +964,6 @@ void BrowsingDataRemover::RemoveImpl(
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::
@@ -1014,6 +1014,9 @@ void BrowsingDataRemover::RemoveImpl(
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