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

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

Issue 2298173002: Implement host-based deletion for the hostname resolution cache. (Closed)
Patch Set: Take TimeTicks::Now() out of the loop Created 4 years, 4 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/io_thread.h » ('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 cf4f0af778df91208481c01ea16ddb2edd4b9b25..6fac81ff09112e3821b44f7dacaed5a072dfad00 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover.cc
@@ -168,10 +168,12 @@ bool ForwardPrimaryPatternCallback(
return predicate.Run(primary_pattern);
}
-void ClearHostnameResolutionCacheOnIOThread(IOThread* io_thread) {
+void ClearHostnameResolutionCacheOnIOThread(
+ IOThread* io_thread,
+ base::Callback<bool(const std::string&)> host_filter) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- io_thread->ClearHostCache();
+ io_thread->ClearHostCache(host_filter);
}
void ClearNetworkPredictorOnIOThread(chrome_browser_net::Predictor* predictor) {
@@ -521,15 +523,18 @@ void BrowsingDataRemover::RemoveImpl(
origin_power_map->ClearOriginMap();
// Need to clear the host cache and accumulated speculative data, as it also
- // reveals some history: we have no mechanism to track when these items were
- // created, so we'll clear them all. Better safe than sorry.
+ // reveals some history. We have no mechanism to track when these items were
+ // created, so we'll not honor the time range.
+ // TODO(msramek): We can use the plugin filter here because plugins, same
+ // as the hostname resolution cache, key their entries by hostname. Rename
+ // BuildPluginFilter() to something more general to reflect this use.
if (g_browser_process->io_thread()) {
- // TODO(dmurph): Support all backends with filter (crbug.com/113621).
waiting_for_clear_hostname_resolution_cache_ = true;
BrowserThread::PostTaskAndReply(
BrowserThread::IO, FROM_HERE,
base::Bind(&ClearHostnameResolutionCacheOnIOThread,
- g_browser_process->io_thread()),
+ g_browser_process->io_thread(),
+ filter_builder.BuildPluginFilter()),
base::Bind(&BrowsingDataRemover::OnClearedHostnameResolutionCache,
weak_ptr_factory_.GetWeakPtr()));
}
« no previous file with comments | « no previous file | chrome/browser/io_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698