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

Unified Diff: net/proxy/proxy_config_service_linux_unittest.cc

Issue 8742001: Convert more NewRunnable* to 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_config_service_linux_unittest.cc
===================================================================
--- net/proxy/proxy_config_service_linux_unittest.cc (revision 112073)
+++ net/proxy/proxy_config_service_linux_unittest.cc (working copy)
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/file_path.h"
#include "base/file_util.h"
@@ -269,8 +270,8 @@
io_thread_.StartWithOptions(options);
// Make sure the thread started.
- io_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &SynchConfigGetter::Init));
+ io_thread_.message_loop()->PostTask(FROM_HERE,
+ base::Bind(&SynchConfigGetter::Init, base::Unretained(this)));
Wait();
}
@@ -279,8 +280,8 @@
// before cleaning up that thread.
delete config_service_;
// Clean up the IO thread.
- io_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &SynchConfigGetter::Cleanup));
+ io_thread_.message_loop()->PostTask(FROM_HERE,
+ base::Bind(&SynchConfigGetter::CleanUp, base::Unretained(this)));
Wait();
}
@@ -298,8 +299,9 @@
// Synchronously gets the proxy config.
net::ProxyConfigService::ConfigAvailability SyncGetLatestProxyConfig(
net::ProxyConfig* config) {
- io_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &SynchConfigGetter::GetLatestConfigOnIOThread));
+ io_thread_.message_loop()->PostTask(FROM_HERE,
+ base::Bind(&SynchConfigGetter::GetLatestConfigOnIOThread,
+ base::Unretained(this)));
Wait();
*config = proxy_config_;
return get_latest_config_result_;
@@ -320,7 +322,7 @@
}
// [Runs on |io_thread_|] Signals |event_| on cleanup completion.
- void Cleanup() {
+ void CleanUp() {
MessageLoop::current()->RunAllPending();
event_.Signal();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698