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

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: Bad merge. 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 | chrome_frame/chrome_frame_automation.cc » ('j') | chrome_frame/test/infobar_unittests.cc » ('J')
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..2f5a474db789338f358ec9b7edfb01fdadcf4091 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,26 @@ 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::Bind(&IPC::Channel::Listener::OnMessageReceived,
+ base::Unretained(listener), m),
+ t.InMilliseconds());
}
MockCFProxyTraits() : ipc_loop(NULL) {}
@@ -131,7 +140,6 @@ struct MockCFProxyTraits : public CFProxyTraits {
&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 +331,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 +356,9 @@ 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::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 | « no previous file | chrome_frame/chrome_frame_automation.cc » ('j') | chrome_frame/test/infobar_unittests.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698