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

Unified Diff: content/test/test_url_fetcher_factory.cc

Issue 8556001: Convert NewRunnableFunction/NewRunnableMethod calls to use base::Bind(). (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: content/test/test_url_fetcher_factory.cc
diff --git a/content/test/test_url_fetcher_factory.cc b/content/test/test_url_fetcher_factory.cc
index 2e0fbd43ac94aaad9328e845d853fa81a5c1c787..a29db042c5d7797cd5a2174ca93fe2ec5e82ca83 100644
--- a/content/test/test_url_fetcher_factory.cc
+++ b/content/test/test_url_fetcher_factory.cc
@@ -6,7 +6,9 @@
#include <string>
+#include "base/bind.h"
#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
#include "content/common/net/url_fetcher_impl.h"
#include "content/public/common/url_fetcher_delegate.h"
@@ -246,7 +248,7 @@ class FakeURLFetcher : public TestURLFetcher {
virtual void Start() OVERRIDE {
MessageLoop::current()->PostTask(
FROM_HERE,
- method_factory_.NewRunnableMethod(&FakeURLFetcher::RunDelegate));
+ base::Bind(&FakeURLFetcher::RunDelegate, method_factory_.GetWeakPtr()));
}
virtual const GURL& GetURL() const OVERRIDE {
@@ -264,7 +266,7 @@ class FakeURLFetcher : public TestURLFetcher {
}
// Method factory used to run the delegate.
- ScopedRunnableMethodFactory<FakeURLFetcher> method_factory_;
+ base::WeakPtrFactory<FakeURLFetcher> method_factory_;
James Hawkins 2011/11/14 17:57:06 weak_factory_
dcheng 2011/11/14 20:47:49 Done.
DISALLOW_COPY_AND_ASSIGN(FakeURLFetcher);
};

Powered by Google App Engine
This is Rietveld 408576698