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

Unified Diff: chrome_frame/cfproxy_test.cc

Issue 8555001: base::Bind: Convert chrome_frame/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win-dies. 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 | « base/threading/worker_pool.h ('k') | chrome_frame/chrome_frame_automation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/cfproxy_test.cc
diff --git a/chrome_frame/cfproxy_test.cc b/chrome_frame/cfproxy_test.cc
index 65990003b2a6e30a3dc5ac6d213edebca8a1ad01..417413322176f41777e2e9be1643d9c83a5e5439 100644
--- a/chrome_frame/cfproxy_test.cc
+++ b/chrome_frame/cfproxy_test.cc
@@ -3,6 +3,9 @@
// found in the LICENSE file.
#include <string>
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/waitable_event.h"
@@ -101,20 +104,28 @@ struct MockCFProxyTraits : public CFProxyTraits {
// You may find API_FIRE_XXXX macros (see below) handy instead.
void FireConnect(base::TimeDelta t) {
ASSERT_TRUE(ipc_loop != NULL);
- ipc_loop->PostDelayedTask(FROM_HERE, NewRunnableMethod(listener,
- &IPC::Channel::Listener::OnChannelConnected, 0), t.InMilliseconds());
+ ipc_loop->PostDelayedTask(
+ FROM_HERE, base::Bind(&IPC::Channel::Listener::OnChannelConnected,
+ base::Unretained(listener), 0),
+ t.InMilliseconds());
}
void FireError(base::TimeDelta t) {
ASSERT_TRUE(ipc_loop != NULL);
- ipc_loop->PostDelayedTask(FROM_HERE, NewRunnableMethod(listener,
- &IPC::Channel::Listener::OnChannelError), t.InMilliseconds());
+ ipc_loop->PostDelayedTask(
+ FROM_HERE, base::Bind(&IPC::Channel::Listener::OnChannelError,
+ base::Unretained(listener)),
+ t.InMilliseconds());
}
void FireMessage(const IPC::Message& m, base::TimeDelta t) {
ASSERT_TRUE(ipc_loop != NULL);
- ipc_loop->PostDelayedTask(FROM_HERE, NewRunnableMethod(listener,
- &IPC::Channel::Listener::OnMessageReceived, m), t.InMilliseconds());
+ ipc_loop->PostDelayedTask(
+ FROM_HERE,
+ base::IgnoreReturn<bool>(
+ base::Bind(&IPC::Channel::Listener::OnMessageReceived,
+ base::Unretained(listener), m)),
+ t.InMilliseconds());
}
MockCFProxyTraits() : ipc_loop(NULL) {}
@@ -124,14 +135,13 @@ struct MockCFProxyTraits : public CFProxyTraits {
IPC::Channel::Listener* listener;
};
-// Handy macros when we want so similate something on the IPC thread.
+// Handy macros when we want so simulate something on the IPC thread.
#define API_FIRE_CONNECT(api, t) InvokeWithoutArgs(CreateFunctor(&api, \
&MockCFProxyTraits::FireConnect, t))
#define API_FIRE_ERROR(api, t) InvokeWithoutArgs(CreateFunctor(&api, \
&MockCFProxyTraits::FireError, t))
#define API_FIRE_MESSAGE(api, t) InvokeWithoutArgs(CreateFunctor(&api, \
&MockCFProxyTraits::FireMessage, t))
-DISABLE_RUNNABLE_METHOD_REFCOUNT(IPC::Channel::Listener);
TEST(ChromeProxy, DelegateAddRemove) {
StrictMock<MockCFProxyTraits> api;
@@ -323,7 +333,6 @@ inline IPC::Message* CreateReply(M* m, const A& a, const B& b, const C& c,
return r;
}} // namespace
-DISABLE_RUNNABLE_METHOD_REFCOUNT(SyncMsgSender);
TEST(SyncMsgSender, Deserialize) {
// Note the ipc thread is not actually needed, but we try to be close
// to real-world conditions - that SyncMsgSender works from multiple threads.
@@ -349,8 +358,10 @@ TEST(SyncMsgSender, Deserialize) {
kSessionId));
// Execute replies in a worker thread.
- ipc.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(&queue,
- &SyncMsgSender::OnReplyReceived, r.get()));
+ ipc.message_loop()->PostTask(
+ FROM_HERE,
+ base::IgnoreReturn<bool>(base::Bind(&SyncMsgSender::OnReplyReceived,
+ base::Unretained(&queue), r.get())));
ipc.Stop();
// Expect that tab 6 has been associated with the delegate.
« no previous file with comments | « base/threading/worker_pool.h ('k') | chrome_frame/chrome_frame_automation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698