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

Unified Diff: ipc/ipc_channel_win.cc

Issue 5598010: Convert over to channel handles (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed up bad whitespace Created 10 years 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
Index: ipc/ipc_channel_win.cc
diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc
index 31d1d1850daabc38b217e3e92f19b45f1bef3567..28a880d24facc5ce55d9f67021032d1dfa775b6a 100644
--- a/ipc/ipc_channel_win.cc
+++ b/ipc/ipc_channel_win.cc
@@ -97,8 +97,8 @@ Channel::ChannelImpl::State::~State() {
//------------------------------------------------------------------------------
-Channel::ChannelImpl::ChannelImpl(const std::string& channel_id, Mode mode,
- Listener* listener)
+Channel::ChannelImpl::ChannelImpl(const IPC::ChannelHandle &channel_handle,
+ Mode mode, Listener* listener)
: ALLOW_THIS_IN_INITIALIZER_LIST(input_state_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(output_state_(this)),
pipe_(INVALID_HANDLE_VALUE),
@@ -106,9 +106,9 @@ Channel::ChannelImpl::ChannelImpl(const std::string& channel_id, Mode mode,
waiting_connect_(mode == MODE_SERVER),
processing_incoming_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {
- if (!CreatePipe(channel_id, mode)) {
+ if (!CreatePipe(channel_handle, mode)) {
// The pipe may have been closed already.
- LOG(WARNING) << "Unable to create pipe named \"" << channel_id <<
+ LOG(WARNING) << "Unable to create pipe named \"" << channel_handle.name <<
"\" in " << (mode == 0 ? "server" : "client") << " mode.";
}
}
@@ -175,10 +175,10 @@ const std::wstring Channel::ChannelImpl::PipeName(
return ss.str();
}
-bool Channel::ChannelImpl::CreatePipe(const std::string& channel_id,
+bool Channel::ChannelImpl::CreatePipe(const IPC::ChannelHandle &channel_handle,
Mode mode) {
DCHECK(pipe_ == INVALID_HANDLE_VALUE);
- const std::wstring pipe_name = PipeName(channel_id);
+ const std::wstring pipe_name = PipeName(channel_handle.name);
if (mode == MODE_SERVER) {
SECURITY_ATTRIBUTES security_attributes = {0};
security_attributes.bInheritHandle = FALSE;
@@ -469,9 +469,9 @@ void Channel::ChannelImpl::OnIOCompleted(MessageLoopForIO::IOContext* context,
//------------------------------------------------------------------------------
// Channel's methods simply call through to ChannelImpl.
-Channel::Channel(const std::string& channel_id, Mode mode,
+Channel::Channel(const IPC::ChannelHandle &channel_handle, Mode mode,
Listener* listener)
- : channel_impl_(new ChannelImpl(channel_id, mode, listener)) {
+ : channel_impl_(new ChannelImpl(channel_handle, mode, listener)) {
}
Channel::~Channel() {
« ipc/ipc_channel_proxy.cc ('K') | « ipc/ipc_channel_win.h ('k') | ipc/ipc_sync_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698