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

Unified Diff: ipc/ipc_channel_posix.cc

Issue 4202004: Add named testing interface (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_posix.cc
===================================================================
--- ipc/ipc_channel_posix.cc (revision 67218)
+++ ipc/ipc_channel_posix.cc (working copy)
@@ -273,8 +273,9 @@
: mode_(mode),
is_blocked_on_write_(false),
message_send_bytes_written_(0),
- uses_fifo_(CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kIPCUseFIFO)),
+ uses_fifo_(
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kIPCUseFIFO) ||
+ mode == MODE_NAMED_SERVER || mode == MODE_NAMED_CLIENT),
server_listen_pipe_(-1),
pipe_(-1),
client_pipe_(-1),
@@ -285,10 +286,15 @@
listener_(listener),
waiting_connect_(true),
factory_(this) {
- if (!CreatePipe(channel_id, mode)) {
+ if (mode_ == MODE_NAMED_SERVER)
+ mode_ = MODE_SERVER;
+ if (mode_ == MODE_NAMED_CLIENT)
+ mode_ = MODE_CLIENT;
+
+ 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";
}
}
@@ -346,7 +352,7 @@
// 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_ = "/var/tmp/chrome_" + channel_id;
+ pipe_name_ = channel_id;
if (mode == MODE_SERVER) {
if (!CreateServerFifo(pipe_name_, &server_listen_pipe_)) {
return false;
« no previous file with comments | « ipc/ipc_channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698