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

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

Issue 328703002: Do not de-reference Profile on the IO thread in BrowsingDataRemover. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.h ('k') | no next file » | 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 da2bb2f5c84dc5b49353b26421ec3a47ccc3dcc6..6c9b999d90a6ae42acc2f2a118edd35caeedca91 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover.cc
@@ -312,7 +312,8 @@ void BrowsingDataRemover::RemoveImpl(int remove_mask,
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&BrowsingDataRemover::ClearNetworkPredictorOnIOThread,
- base::Unretained(this)));
+ base::Unretained(this),
+ profile_->GetNetworkPredictor()));
}
// As part of history deletion we also delete the auto-generated keywords.
@@ -864,14 +865,12 @@ void BrowsingDataRemover::OnClearedNetworkPredictor() {
NotifyAndDeleteIfDone();
}
-void BrowsingDataRemover::ClearNetworkPredictorOnIOThread() {
+void BrowsingDataRemover::ClearNetworkPredictorOnIOThread(
+ chrome_browser_net::Predictor* predictor) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- chrome_browser_net::Predictor* predictor = profile_->GetNetworkPredictor();
- if (predictor) {
Mike West 2014/06/10 12:33:13 Can this be null? If not, can we DCHECK?
engedy 2014/06/10 15:19:40 Indeed, this must be non-NULL, otherwise the metho
- predictor->DiscardInitialNavigationHistory();
- predictor->DiscardAllResults();
- }
+ predictor->DiscardInitialNavigationHistory();
+ predictor->DiscardAllResults();
// Notify the UI thread that we are done.
BrowserThread::PostTask(
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698