Commit 31a7eef7 authored by jhawkins@chromium.org's avatar jhawkins@chromium.org

base::Bind: Convert jingle/.

BUG=none
TEST=none

R=csilv@chromium.org

Review URL: http://codereview.chromium.org/8551004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109811 0039d316-1c4b-4281-b951-d872f2087c98
parent 72b6f8e2
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "jingle/glue/fake_network_manager.h" #include "jingle/glue/fake_network_manager.h"
#include "base/bind.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/message_loop.h" #include "base/message_loop.h"
#include "net/base/ip_endpoint.h" #include "net/base/ip_endpoint.h"
...@@ -14,7 +15,7 @@ namespace jingle_glue { ...@@ -14,7 +15,7 @@ namespace jingle_glue {
FakeNetworkManager::FakeNetworkManager(const net::IPAddressNumber& address) FakeNetworkManager::FakeNetworkManager(const net::IPAddressNumber& address)
: started_(false), : started_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)) { ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
net::IPEndPoint endpoint(address, 0); net::IPEndPoint endpoint(address, 0);
talk_base::SocketAddress socket_address; talk_base::SocketAddress socket_address;
CHECK(IPEndPointToSocketAddress(endpoint, &socket_address)); CHECK(IPEndPointToSocketAddress(endpoint, &socket_address));
...@@ -28,8 +29,8 @@ FakeNetworkManager::~FakeNetworkManager() { ...@@ -28,8 +29,8 @@ FakeNetworkManager::~FakeNetworkManager() {
void FakeNetworkManager::StartUpdating() { void FakeNetworkManager::StartUpdating() {
started_ = true; started_ = true;
MessageLoop::current()->PostTask( MessageLoop::current()->PostTask(
FROM_HERE,task_factory_.NewRunnableMethod( FROM_HERE, base::Bind(&FakeNetworkManager::SendNetworksChangedSignal,
&FakeNetworkManager::SendNetworksChangedSignal)); weak_factory_.GetWeakPtr()));
} }
void FakeNetworkManager::StopUpdating() { void FakeNetworkManager::StopUpdating() {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/task.h" #include "base/memory/weak_ptr.h"
#include "net/base/net_util.h" #include "net/base/net_util.h"
#include "third_party/libjingle/source/talk/base/network.h" #include "third_party/libjingle/source/talk/base/network.h"
...@@ -33,7 +33,7 @@ class FakeNetworkManager : public talk_base::NetworkManager { ...@@ -33,7 +33,7 @@ class FakeNetworkManager : public talk_base::NetworkManager {
bool started_; bool started_;
scoped_ptr<talk_base::Network> network_; scoped_ptr<talk_base::Network> network_;
ScopedRunnableMethodFactory<FakeNetworkManager> task_factory_; base::WeakPtrFactory<FakeNetworkManager> weak_factory_;
}; };
} // namespace jingle_glue } // namespace jingle_glue
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "jingle/glue/fake_socket_factory.h" #include "jingle/glue/fake_socket_factory.h"
#include "base/bind.h"
#include "base/message_loop.h" #include "base/message_loop.h"
#include "jingle/glue/utils.h" #include "jingle/glue/utils.h"
#include "third_party/libjingle/source/talk/base/asyncsocket.h" #include "third_party/libjingle/source/talk/base/asyncsocket.h"
...@@ -125,8 +126,8 @@ void FakeSocketManager::SendPacket(const net::IPEndPoint& from, ...@@ -125,8 +126,8 @@ void FakeSocketManager::SendPacket(const net::IPEndPoint& from,
DCHECK_EQ(MessageLoop::current(), message_loop_); DCHECK_EQ(MessageLoop::current(), message_loop_);
message_loop_->PostTask( message_loop_->PostTask(
FROM_HERE, NewRunnableMethod(this, &FakeSocketManager::DeliverPacket, FROM_HERE,
from, to, data)); base::Bind(&FakeSocketManager::DeliverPacket, this, from, to, data));
} }
void FakeSocketManager::DeliverPacket(const net::IPEndPoint& from, void FakeSocketManager::DeliverPacket(const net::IPEndPoint& from,
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <vector> #include <vector>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "jingle/glue/thread_wrapper.h" #include "jingle/glue/thread_wrapper.h"
#include "net/base/io_buffer.h" #include "net/base/io_buffer.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
...@@ -21,8 +23,6 @@ class FakeSocket; ...@@ -21,8 +23,6 @@ class FakeSocket;
} // namespace } // namespace
} // namespace jingle_glue } // namespace jingle_glue
DISABLE_RUNNABLE_METHOD_REFCOUNT(jingle_glue::FakeSocket);
namespace jingle_glue { namespace jingle_glue {
namespace { namespace {
...@@ -136,9 +136,12 @@ class FakeSocket : public net::Socket { ...@@ -136,9 +136,12 @@ class FakeSocket : public net::Socket {
net::OldCompletionCallback* callback) OVERRIDE { net::OldCompletionCallback* callback) OVERRIDE {
DCHECK(buf); DCHECK(buf);
if (peer_socket_) { if (peer_socket_) {
MessageLoop::current()->PostDelayedTask(FROM_HERE, NewRunnableMethod( MessageLoop::current()->PostDelayedTask(
peer_socket_, &FakeSocket::AppendInputPacket, FROM_HERE,
std::vector<char>(buf->data(), buf->data() + buf_len)), latency_ms_); base::Bind(&FakeSocket::AppendInputPacket,
base::Unretained(peer_socket_),
std::vector<char>(buf->data(), buf->data() + buf_len)),
latency_ms_);
} }
return buf_len; return buf_len;
...@@ -186,7 +189,7 @@ class TCPChannelTester : public base::RefCountedThreadSafe<TCPChannelTester> { ...@@ -186,7 +189,7 @@ class TCPChannelTester : public base::RefCountedThreadSafe<TCPChannelTester> {
void Start() { void Start() {
message_loop_->PostTask( message_loop_->PostTask(
FROM_HERE, NewRunnableMethod(this, &TCPChannelTester::DoStart)); FROM_HERE, base::Bind(&TCPChannelTester::DoStart, this));
} }
void CheckResults() { void CheckResults() {
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "jingle/glue/thread_wrapper.h" #include "jingle/glue/thread_wrapper.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/threading/thread_local.h" #include "base/threading/thread_local.h"
...@@ -153,8 +155,9 @@ void JingleThreadWrapper::Send(talk_base::MessageHandler *handler, uint32 id, ...@@ -153,8 +155,9 @@ void JingleThreadWrapper::Send(talk_base::MessageHandler *handler, uint32 id,
// Need to signal |pending_send_event_| here in case the thread is // Need to signal |pending_send_event_| here in case the thread is
// sending message to another thread. // sending message to another thread.
pending_send_event_.Signal(); pending_send_event_.Signal();
message_loop_->PostTask(FROM_HERE, NewRunnableMethod( message_loop_->PostTask(FROM_HERE,
this, &JingleThreadWrapper::ProcessPendingSends)); base::Bind(&JingleThreadWrapper::ProcessPendingSends,
base::Unretained(this)));
while (!pending_send.done_event.IsSignaled()) { while (!pending_send.done_event.IsSignaled()) {
...@@ -204,13 +207,14 @@ void JingleThreadWrapper::PostTaskInternal( ...@@ -204,13 +207,14 @@ void JingleThreadWrapper::PostTaskInternal(
} }
if (delay_ms <= 0) { if (delay_ms <= 0) {
message_loop_->PostTask(FROM_HERE, NewRunnableMethod( message_loop_->PostTask(FROM_HERE,
this, &JingleThreadWrapper::RunTask, task_id)); base::Bind(&JingleThreadWrapper::RunTask,
base::Unretained(this), task_id));
} else { } else {
message_loop_->PostDelayedTask( message_loop_->PostDelayedTask(FROM_HERE,
FROM_HERE, base::Bind(&JingleThreadWrapper::RunTask,
NewRunnableMethod(this, &JingleThreadWrapper::RunTask, task_id), base::Unretained(this), task_id),
delay_ms); delay_ms);
} }
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <cstdlib> #include <cstdlib>
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/bind.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/message_loop.h" #include "base/message_loop.h"
...@@ -43,8 +44,7 @@ ChromeAsyncSocket::ChromeAsyncSocket( ...@@ -43,8 +44,7 @@ ChromeAsyncSocket::ChromeAsyncSocket(
state_(STATE_CLOSED), state_(STATE_CLOSED),
error_(ERROR_NONE), error_(ERROR_NONE),
net_error_(net::OK), net_error_(net::OK),
scoped_runnable_method_factory_( ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(this)),
read_state_(IDLE), read_state_(IDLE),
read_buf_(new net::IOBufferWithSize(read_buf_size)), read_buf_(new net::IOBufferWithSize(read_buf_size)),
read_start_(0U), read_start_(0U),
...@@ -112,8 +112,7 @@ bool ChromeAsyncSocket::Connect(const talk_base::SocketAddress& address) { ...@@ -112,8 +112,7 @@ bool ChromeAsyncSocket::Connect(const talk_base::SocketAddress& address) {
state_ = STATE_CONNECTING; state_ = STATE_CONNECTING;
DCHECK(scoped_runnable_method_factory_.empty()); DCHECK_EQ(false, weak_factory_.HasWeakPtrs());
scoped_runnable_method_factory_.RevokeAll();
net::HostPortPair dest_host_port_pair(address.IPAsString(), address.port()); net::HostPortPair dest_host_port_pair(address.IPAsString(), address.port());
...@@ -128,10 +127,9 @@ bool ChromeAsyncSocket::Connect(const talk_base::SocketAddress& address) { ...@@ -128,10 +127,9 @@ bool ChromeAsyncSocket::Connect(const talk_base::SocketAddress& address) {
// the connect always happens asynchronously. // the connect always happens asynchronously.
MessageLoop* message_loop = MessageLoop::current(); MessageLoop* message_loop = MessageLoop::current();
CHECK(message_loop); CHECK(message_loop);
message_loop->PostTask( message_loop->PostTask(FROM_HERE,
FROM_HERE, base::Bind(&ChromeAsyncSocket::ProcessConnectDone,
scoped_runnable_method_factory_.NewRunnableMethod( weak_factory_.GetWeakPtr(), status));
&ChromeAsyncSocket::ProcessConnectDone, status));
} }
return true; return true;
} }
...@@ -167,8 +165,7 @@ void ChromeAsyncSocket::PostDoRead() { ...@@ -167,8 +165,7 @@ void ChromeAsyncSocket::PostDoRead() {
CHECK(message_loop); CHECK(message_loop);
message_loop->PostTask( message_loop->PostTask(
FROM_HERE, FROM_HERE,
scoped_runnable_method_factory_.NewRunnableMethod( base::Bind(&ChromeAsyncSocket::DoRead, weak_factory_.GetWeakPtr()));
&ChromeAsyncSocket::DoRead));
read_state_ = POSTED; read_state_ = POSTED;
} }
...@@ -299,8 +296,7 @@ void ChromeAsyncSocket::PostDoWrite() { ...@@ -299,8 +296,7 @@ void ChromeAsyncSocket::PostDoWrite() {
CHECK(message_loop); CHECK(message_loop);
message_loop->PostTask( message_loop->PostTask(
FROM_HERE, FROM_HERE,
scoped_runnable_method_factory_.NewRunnableMethod( base::Bind(&ChromeAsyncSocket::DoWrite, weak_factory_.GetWeakPtr()));
&ChromeAsyncSocket::DoWrite));
write_state_ = POSTED; write_state_ = POSTED;
} }
...@@ -367,7 +363,7 @@ bool ChromeAsyncSocket::Close() { ...@@ -367,7 +363,7 @@ bool ChromeAsyncSocket::Close() {
// (not STATE_CLOSED) -> STATE_CLOSED // (not STATE_CLOSED) -> STATE_CLOSED
void ChromeAsyncSocket::DoClose() { void ChromeAsyncSocket::DoClose() {
scoped_runnable_method_factory_.RevokeAll(); weak_factory_.InvalidateWeakPtrs();
if (transport_socket_.get()) { if (transport_socket_.get()) {
transport_socket_->Disconnect(); transport_socket_->Disconnect();
} }
...@@ -404,7 +400,7 @@ bool ChromeAsyncSocket::StartTls(const std::string& domain_name) { ...@@ -404,7 +400,7 @@ bool ChromeAsyncSocket::StartTls(const std::string& domain_name) {
DCHECK_EQ(write_end_, 0U); DCHECK_EQ(write_end_, 0U);
// Clear out any posted DoRead() tasks. // Clear out any posted DoRead() tasks.
scoped_runnable_method_factory_.RevokeAll(); weak_factory_.InvalidateWeakPtrs();
DCHECK(transport_socket_.get()); DCHECK(transport_socket_.get());
net::ClientSocketHandle* socket_handle = new net::ClientSocketHandle(); net::ClientSocketHandle* socket_handle = new net::ClientSocketHandle();
...@@ -416,10 +412,9 @@ bool ChromeAsyncSocket::StartTls(const std::string& domain_name) { ...@@ -416,10 +412,9 @@ bool ChromeAsyncSocket::StartTls(const std::string& domain_name) {
if (status != net::ERR_IO_PENDING) { if (status != net::ERR_IO_PENDING) {
MessageLoop* message_loop = MessageLoop::current(); MessageLoop* message_loop = MessageLoop::current();
CHECK(message_loop); CHECK(message_loop);
message_loop->PostTask( message_loop->PostTask(FROM_HERE,
FROM_HERE, base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone,
scoped_runnable_method_factory_.NewRunnableMethod( weak_factory_.GetWeakPtr(), status));
&ChromeAsyncSocket::ProcessSSLConnectDone, status));
} }
return true; return true;
} }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/task.h" #include "base/memory/weak_ptr.h"
#include "net/base/completion_callback.h" #include "net/base/completion_callback.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
#include "talk/xmpp/asyncsocket.h" #include "talk/xmpp/asyncsocket.h"
...@@ -189,8 +189,7 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { ...@@ -189,8 +189,7 @@ class ChromeAsyncSocket : public buzz::AsyncSocket {
net::Error net_error_; net::Error net_error_;
// Used by read/write loops. // Used by read/write loops.
ScopedRunnableMethodFactory<ChromeAsyncSocket> base::WeakPtrFactory<ChromeAsyncSocket> weak_factory_;
scoped_runnable_method_factory_;
// NULL iff state() == STATE_CLOSED. // NULL iff state() == STATE_CLOSED.
// //
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "jingle/notifier/base/proxy_resolving_client_socket.h" #include "jingle/notifier/base/proxy_resolving_client_socket.h"
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/bind.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/logging.h" #include "base/logging.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
...@@ -35,8 +36,7 @@ ProxyResolvingClientSocket::ProxyResolvingClientSocket( ...@@ -35,8 +36,7 @@ ProxyResolvingClientSocket::ProxyResolvingClientSocket(
net::BoundNetLog::Make( net::BoundNetLog::Make(
request_context_getter->GetURLRequestContext()->net_log(), request_context_getter->GetURLRequestContext()->net_log(),
net::NetLog::SOURCE_SOCKET)), net::NetLog::SOURCE_SOCKET)),
scoped_runnable_method_factory_( ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(this)),
user_connect_callback_(NULL) { user_connect_callback_(NULL) {
DCHECK(request_context_getter); DCHECK(request_context_getter);
net::URLRequestContext* request_context = net::URLRequestContext* request_context =
...@@ -117,8 +117,8 @@ int ProxyResolvingClientSocket::Connect(net::OldCompletionCallback* callback) { ...@@ -117,8 +117,8 @@ int ProxyResolvingClientSocket::Connect(net::OldCompletionCallback* callback) {
CHECK(message_loop); CHECK(message_loop);
message_loop->PostTask( message_loop->PostTask(
FROM_HERE, FROM_HERE,
scoped_runnable_method_factory_.NewRunnableMethod( base::Bind(&ProxyResolvingClientSocket::ProcessProxyResolveDone,
&ProxyResolvingClientSocket::ProcessProxyResolveDone, status)); weak_factory_.GetWeakPtr(), status));
} }
user_connect_callback_ = callback; user_connect_callback_ = callback;
return net::ERR_IO_PENDING; return net::ERR_IO_PENDING;
...@@ -270,8 +270,8 @@ int ProxyResolvingClientSocket::ReconsiderProxyAfterError(int error) { ...@@ -270,8 +270,8 @@ int ProxyResolvingClientSocket::ReconsiderProxyAfterError(int error) {
CHECK(message_loop); CHECK(message_loop);
message_loop->PostTask( message_loop->PostTask(
FROM_HERE, FROM_HERE,
scoped_runnable_method_factory_.NewRunnableMethod( base::Bind(&ProxyResolvingClientSocket::ProcessProxyResolveDone,
&ProxyResolvingClientSocket::ProcessProxyResolveDone, rv)); weak_factory_.GetWeakPtr(), rv));
// Since we potentially have another try to go (trying the direct connect) // Since we potentially have another try to go (trying the direct connect)
// set the return code code to ERR_IO_PENDING. // set the return code code to ERR_IO_PENDING.
rv = net::ERR_IO_PENDING; rv = net::ERR_IO_PENDING;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "net/base/completion_callback.h" #include "net/base/completion_callback.h"
#include "net/base/host_port_pair.h" #include "net/base/host_port_pair.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
...@@ -90,8 +91,7 @@ class ProxyResolvingClientSocket : public net::StreamSocket { ...@@ -90,8 +91,7 @@ class ProxyResolvingClientSocket : public net::StreamSocket {
net::HostPortPair dest_host_port_pair_; net::HostPortPair dest_host_port_pair_;
bool tried_direct_connect_fallback_; bool tried_direct_connect_fallback_;
net::BoundNetLog bound_net_log_; net::BoundNetLog bound_net_log_;
ScopedRunnableMethodFactory<ProxyResolvingClientSocket> base::WeakPtrFactory<ProxyResolvingClientSocket> weak_factory_;
scoped_runnable_method_factory_;
// The callback passed to Connect(). // The callback passed to Connect().
net::OldCompletionCallback* user_connect_callback_; net::OldCompletionCallback* user_connect_callback_;
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/bind.h"
#include "base/message_loop.h" #include "base/message_loop.h"
#include "jingle/notifier/base/task_pump.h" #include "jingle/notifier/base/task_pump.h"
namespace notifier { namespace notifier {
TaskPump::TaskPump() TaskPump::TaskPump()
: scoped_runnable_method_factory_( : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(this)),
posted_wake_(false), posted_wake_(false),
stopped_(false) {} stopped_(false) {}
...@@ -25,8 +25,7 @@ void TaskPump::WakeTasks() { ...@@ -25,8 +25,7 @@ void TaskPump::WakeTasks() {
// Do the requested wake up. // Do the requested wake up.
current_message_loop->PostTask( current_message_loop->PostTask(
FROM_HERE, FROM_HERE,
scoped_runnable_method_factory_.NewRunnableMethod( base::Bind(&TaskPump::CheckAndRunTasks, weak_factory_.GetWeakPtr()));
&TaskPump::CheckAndRunTasks));
posted_wake_ = true; posted_wake_ = true;
} }
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef JINGLE_NOTIFIER_BASE_TASK_PUMP_H_ #ifndef JINGLE_NOTIFIER_BASE_TASK_PUMP_H_
#define JINGLE_NOTIFIER_BASE_TASK_PUMP_H_ #define JINGLE_NOTIFIER_BASE_TASK_PUMP_H_
#include "base/memory/weak_ptr.h"
#include "base/task.h" #include "base/task.h"
#include "base/threading/non_thread_safe.h" #include "base/threading/non_thread_safe.h"
#include "talk/base/taskrunner.h" #include "talk/base/taskrunner.h"
...@@ -29,7 +30,7 @@ class TaskPump : public talk_base::TaskRunner { ...@@ -29,7 +30,7 @@ class TaskPump : public talk_base::TaskRunner {
void CheckAndRunTasks(); void CheckAndRunTasks();
base::NonThreadSafe non_thread_safe_; base::NonThreadSafe non_thread_safe_;
ScopedRunnableMethodFactory<TaskPump> scoped_runnable_method_factory_; base::WeakPtrFactory<TaskPump> weak_factory_;
bool posted_wake_; bool posted_wake_;
bool stopped_; bool stopped_;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "jingle/notifier/listener/mediator_thread_impl.h" #include "jingle/notifier/listener/mediator_thread_impl.h"
#include "base/bind.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
...@@ -242,9 +243,7 @@ void MediatorThreadImpl::Login(const buzz::XmppClientSettings& settings) { ...@@ -242,9 +243,7 @@ void MediatorThreadImpl::Login(const buzz::XmppClientSettings& settings) {
DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread()); DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread());
io_message_loop_proxy_->PostTask( io_message_loop_proxy_->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(core_.get(), base::Bind(&MediatorThreadImpl::Core::Login, core_.get(), settings));
&MediatorThreadImpl::Core::Login,
settings));
} }
void MediatorThreadImpl::Logout() { void MediatorThreadImpl::Logout() {
...@@ -256,8 +255,8 @@ void MediatorThreadImpl::ListenForUpdates() { ...@@ -256,8 +255,8 @@ void MediatorThreadImpl::ListenForUpdates() {
DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread()); DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread());
io_message_loop_proxy_->PostTask( io_message_loop_proxy_->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(core_.get(), base::Bind(&MediatorThreadImpl::Core::ListenForPushNotifications,
&MediatorThreadImpl::Core::ListenForPushNotifications)); core_.get()));
} }
void MediatorThreadImpl::SubscribeForUpdates( void MediatorThreadImpl::SubscribeForUpdates(
...@@ -265,10 +264,8 @@ void MediatorThreadImpl::SubscribeForUpdates( ...@@ -265,10 +264,8 @@ void MediatorThreadImpl::SubscribeForUpdates(
DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread()); DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread());
io_message_loop_proxy_->PostTask( io_message_loop_proxy_->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod( base::Bind(&MediatorThreadImpl::Core::SubscribeForPushNotifications,
core_.get(), core_.get(), subscriptions));
&MediatorThreadImpl::Core::SubscribeForPushNotifications,
subscriptions));
} }
void MediatorThreadImpl::SendNotification( void MediatorThreadImpl::SendNotification(
...@@ -276,9 +273,8 @@ void MediatorThreadImpl::SendNotification( ...@@ -276,9 +273,8 @@ void MediatorThreadImpl::SendNotification(
DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread()); DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread());
io_message_loop_proxy_->PostTask( io_message_loop_proxy_->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(core_.get(), base::Bind(&MediatorThreadImpl::Core::SendNotification, core_.get(),
&MediatorThreadImpl::Core::SendNotification, data));
data));
} }
void MediatorThreadImpl::UpdateXmppSettings( void MediatorThreadImpl::UpdateXmppSettings(
...@@ -286,9 +282,8 @@ void MediatorThreadImpl::UpdateXmppSettings( ...@@ -286,9 +282,8 @@ void MediatorThreadImpl::UpdateXmppSettings(
DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread()); DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread());
io_message_loop_proxy_->PostTask( io_message_loop_proxy_->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(core_.get(), base::Bind(&MediatorThreadImpl::Core::UpdateXmppSettings, core_.get(),
&MediatorThreadImpl::Core::UpdateXmppSettings, settings));
settings));
} }
void MediatorThreadImpl::TriggerOnConnectForTest( void MediatorThreadImpl::TriggerOnConnectForTest(
...@@ -296,16 +291,13 @@ void MediatorThreadImpl::TriggerOnConnectForTest( ...@@ -296,16 +291,13 @@ void MediatorThreadImpl::TriggerOnConnectForTest(
DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread()); DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread());
io_message_loop_proxy_->PostTask( io_message_loop_proxy_->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(core_.get(), base::Bind(&MediatorThreadImpl::Core::OnConnect, core_.get(), base_task));
&MediatorThreadImpl::Core::OnConnect,
base_task));
} }
void MediatorThreadImpl::LogoutImpl() { void MediatorThreadImpl::LogoutImpl() {
io_message_loop_proxy_->PostTask( io_message_loop_proxy_->PostTask(
FROM_HERE, FROM_HERE,
NewRunnableMethod(core_.get(), base::Bind(&MediatorThreadImpl::Core::Disconnect, core_.get()));
&MediatorThreadImpl::Core::Disconnect));
} }
} // namespace notifier } // namespace notifier
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment