diff options
Diffstat (limited to 'ipc/ipc_channel_posix.cc')
-rw-r--r-- | ipc/ipc_channel_posix.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc index 65a04e1..86d1673 100644 --- a/ipc/ipc_channel_posix.cc +++ b/ipc/ipc_channel_posix.cc @@ -273,9 +273,8 @@ Channel::ChannelImpl::ChannelImpl(const std::string& channel_id, Mode mode, : mode_(mode), is_blocked_on_write_(false), message_send_bytes_written_(0), - uses_fifo_( - CommandLine::ForCurrentProcess()->HasSwitch(switches::kIPCUseFIFO) || - mode == MODE_NAMED_SERVER || mode == MODE_NAMED_CLIENT), + uses_fifo_(CommandLine::ForCurrentProcess()->HasSwitch( + switches::kIPCUseFIFO)), server_listen_pipe_(-1), pipe_(-1), client_pipe_(-1), @@ -286,15 +285,10 @@ Channel::ChannelImpl::ChannelImpl(const std::string& channel_id, Mode mode, listener_(listener), waiting_connect_(true), factory_(this) { - if (mode_ == MODE_NAMED_SERVER) - mode_ = MODE_SERVER; - if (mode_ == MODE_NAMED_CLIENT) - mode_ = MODE_CLIENT; - - if (!CreatePipe(channel_id, mode_)) { + if (!CreatePipe(channel_id, mode)) { // The pipe may have been closed already. PLOG(WARNING) << "Unable to create pipe named \"" << channel_id - << "\" in " << (mode_ == MODE_SERVER ? "server" : "client") + << "\" in " << (mode == MODE_SERVER ? "server" : "client") << " mode"; } } @@ -352,7 +346,7 @@ bool Channel::ChannelImpl::CreatePipe(const std::string& channel_id, // TODO(playmobil): We shouldn't need to create fifos on disk. // TODO(playmobil): If we do, they should be in the user data directory. // TODO(playmobil): Cleanup any stale fifos. - pipe_name_ = channel_id; + pipe_name_ = "/var/tmp/chrome_" + channel_id; if (mode == MODE_SERVER) { if (!CreateServerFifo(pipe_name_, &server_listen_pipe_)) { return false; |