OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ipc/ipc_channel_posix.h" | 5 #include "ipc/ipc_channel_posix.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 #else | 334 #else |
335 server_listen_pipe_.reset(local_pipe.release()); | 335 server_listen_pipe_.reset(local_pipe.release()); |
336 #endif | 336 #endif |
337 } else { | 337 } else { |
338 pipe_.reset(local_pipe.release()); | 338 pipe_.reset(local_pipe.release()); |
339 } | 339 } |
340 return true; | 340 return true; |
341 } | 341 } |
342 | 342 |
343 bool ChannelPosix::Connect() { | 343 bool ChannelPosix::Connect() { |
| 344 WillConnect(); |
| 345 |
344 if (!server_listen_pipe_.is_valid() && !pipe_.is_valid()) { | 346 if (!server_listen_pipe_.is_valid() && !pipe_.is_valid()) { |
345 DLOG(WARNING) << "Channel creation failed: " << pipe_name_; | 347 DLOG(WARNING) << "Channel creation failed: " << pipe_name_; |
346 return false; | 348 return false; |
347 } | 349 } |
348 | 350 |
349 bool did_connect = true; | 351 bool did_connect = true; |
350 if (server_listen_pipe_.is_valid()) { | 352 if (server_listen_pipe_.is_valid()) { |
351 #if defined(OS_NACL_NONSFI) | 353 #if defined(OS_NACL_NONSFI) |
352 LOG(FATAL) << "IPC channels in nacl_helper_nonsfi " | 354 LOG(FATAL) << "IPC channels in nacl_helper_nonsfi " |
353 << "should always be in client mode."; | 355 << "should always be in client mode."; |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 // static | 1133 // static |
1132 void Channel::SetGlobalPid(int pid) { | 1134 void Channel::SetGlobalPid(int pid) { |
1133 ChannelPosix::SetGlobalPid(pid); | 1135 ChannelPosix::SetGlobalPid(pid); |
1134 } | 1136 } |
1135 int Channel::GetGlobalPid() { | 1137 int Channel::GetGlobalPid() { |
1136 return ChannelPosix::GetGlobalPid(); | 1138 return ChannelPosix::GetGlobalPid(); |
1137 } | 1139 } |
1138 #endif // OS_LINUX | 1140 #endif // OS_LINUX |
1139 | 1141 |
1140 } // namespace IPC | 1142 } // namespace IPC |
OLD | NEW |