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

Unified Diff: ipc/ipc_channel_win.cc

Issue 8539036: base:Bind: Convert ipc/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix. 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 | « ipc/ipc_channel_win.h ('k') | ipc/ipc_logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_win.cc
diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc
index 3a85a1651fb40b7750dbfa3e7a010c0c21938f8d..cd313d21a96fbd83af6189696ba60960091d8870 100644
--- a/ipc/ipc_channel_win.cc
+++ b/ipc/ipc_channel_win.cc
@@ -7,6 +7,7 @@
#include <windows.h>
#include "base/auto_reset.h"
+#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/threading/non_thread_safe.h"
@@ -35,7 +36,7 @@ Channel::ChannelImpl::ChannelImpl(const IPC::ChannelHandle &channel_handle,
listener_(listener),
waiting_connect_(mode & MODE_SERVER_FLAG),
processing_incoming_(false),
- ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
CreatePipe(channel_handle, mode);
}
@@ -177,8 +178,10 @@ bool Channel::ChannelImpl::Connect() {
// Complete setup asynchronously. By not setting input_state_.is_pending
// to true, we indicate to OnIOCompleted that this is the special
// initialization signal.
- MessageLoopForIO::current()->PostTask(FROM_HERE, factory_.NewRunnableMethod(
- &Channel::ChannelImpl::OnIOCompleted, &input_state_.context, 0, 0));
+ MessageLoopForIO::current()->PostTask(
+ FROM_HERE, base::Bind(&Channel::ChannelImpl::OnIOCompleted,
+ weak_factory_.GetWeakPtr(), &input_state_.context,
+ 0, 0));
}
if (!waiting_connect_)
« no previous file with comments | « ipc/ipc_channel_win.h ('k') | ipc/ipc_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698