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

Unified Diff: chrome/browser/chrome_net_benchmarking_message_filter.cc

Issue 2085643002: Don't clear the net predictors prefs on startup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dont clear prefs on startup Created 4 years, 6 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
Index: chrome/browser/chrome_net_benchmarking_message_filter.cc
diff --git a/chrome/browser/chrome_net_benchmarking_message_filter.cc b/chrome/browser/chrome_net_benchmarking_message_filter.cc
index b95edb47744fc37d27f1bc8e3b94023892d9f32c..74d61ba6fcc7e0a7a910a7b3fe36e073f43b4bc8 100644
--- a/chrome/browser/chrome_net_benchmarking_message_filter.cc
+++ b/chrome/browser/chrome_net_benchmarking_message_filter.cc
@@ -131,8 +131,13 @@ void ChromeNetBenchmarkingMessageFilter::OnClearPredictorCache() {
return;
}
chrome_browser_net::Predictor* predictor = profile_->GetNetworkPredictor();
eroman 2016/06/23 23:48:05 I am confused by the threading model here. We are
Charlie Harrison 2016/06/24 00:00:52 This looks like a bug. If you look at the comments
Charlie Harrison 2016/06/24 16:12:09 Going to punt on this one because I don't have a g
Bernhard Bauer 2016/06/28 11:43:46 Here's what I think we should do: 1) Dispatch this
Charlie Harrison 2016/06/28 17:01:43 Thanks for the suggestions. Those sound good to me
- if (predictor)
+ if (predictor) {
+ content::BrowserThread::PostTask(
+ content::BrowserThread::UI, FROM_HERE,
+ base::Bind(&chrome_browser_net::Predictor::ClearPrefsOnUIThread,
+ base::Unretained(predictor)));
eroman 2016/06/23 23:48:05 is it guaranteed that predictor (and by extension
Charlie Harrison 2016/06/24 00:00:52 Hm I think so but I can't prove it off the top of
eroman 2016/06/24 00:17:28 That might work. I am not totally sure on the des
Bernhard Bauer 2016/06/28 11:43:46 Sadly, no, because the Predictor is destroyed on t
predictor->DiscardAllResults();
+ }
}
bool ChromeNetBenchmarkingMessageFilter::CheckBenchmarkingEnabled() const {

Powered by Google App Engine
This is Rietveld 408576698