Chromium Code Reviews| 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 { |