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

Unified Diff: chrome/browser/net/predictor.cc

Issue 8589012: base::Bind fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/net/predictor.cc
diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc
index 51bc4aecaca3ee190d6db10ba4a9677ff48994f9..8ffcda16af25ec49cda55ca3e822bc3743eb9d96 100644
--- a/chrome/browser/net/predictor.cc
+++ b/chrome/browser/net/predictor.cc
@@ -704,7 +704,8 @@ void Predictor::FinalizeInitializationOnIOThread(
// on the same thread. The predictor lives on the IO thread and will die
// from there so now that we're on the IO thread we need to properly
// initialize the ScopedrunnableMethodFactory.
- trim_task_factory_.reset(new ScopedRunnableMethodFactory<Predictor>(this));
+ // TODO(groby): Check if WeakPtrFactory has the same constraint.
+ weak_factory_.reset(new base::WeakPtrFactory<Predictor>(this));
// Prefetch these hostnames on startup.
DnsPrefetchMotivatedList(startup_urls, UrlInfo::STARTUP_LIST_MOTIVATED);
@@ -1057,8 +1058,8 @@ void Predictor::PostIncrementalTrimTask() {
return;
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- trim_task_factory_->NewRunnableMethod(
- &Predictor::IncrementalTrimReferrers, false),
+ base::Bind(&Predictor::IncrementalTrimReferrers,
+ weak_factory_->GetWeakPtr(), false),
kDurationBetweenTrimmingIncrements.InMilliseconds());
}

Powered by Google App Engine
This is Rietveld 408576698