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

Unified Diff: chrome/browser/net/sdch_dictionary_fetcher.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/sdch_dictionary_fetcher.cc
diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/chrome/browser/net/sdch_dictionary_fetcher.cc
index 660693435585402d05bba4d3f75dc5151d8c314a..4a96f8fff37087d207aeb35681215342861b2e5e 100644
--- a/chrome/browser/net/sdch_dictionary_fetcher.cc
+++ b/chrome/browser/net/sdch_dictionary_fetcher.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/net/sdch_dictionary_fetcher.h"
+#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/message_loop.h"
#include "chrome/browser/profiles/profile.h"
@@ -11,7 +12,7 @@
#include "net/url_request/url_request_status.h"
SdchDictionaryFetcher::SdchDictionaryFetcher()
- : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
+ : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
task_is_pending_(false) {
}
@@ -46,7 +47,8 @@ void SdchDictionaryFetcher::ScheduleDelayedRun() {
if (fetch_queue_.empty() || current_fetch_.get() || task_is_pending_)
return;
MessageLoop::current()->PostDelayedTask(FROM_HERE,
- method_factory_.NewRunnableMethod(&SdchDictionaryFetcher::StartFetching),
+ base::Bind(&SdchDictionaryFetcher::StartFetching,
+ weak_factory_.GetWeakPtr()),
kMsDelayFromRequestTillDownload);
task_is_pending_ = true;
}
« chrome/browser/net/sdch_dictionary_fetcher.h ('K') | « chrome/browser/net/sdch_dictionary_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698