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

Side by Side Diff: ipc/ipc_channel_posix.cc

Issue 1903663004: IPC: Fix attachment brokering race condition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: runtime error Created 4 years, 8 months 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 unified diff | Download patch
OLDNEW
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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 #else 331 #else
332 server_listen_pipe_.reset(local_pipe.release()); 332 server_listen_pipe_.reset(local_pipe.release());
333 #endif 333 #endif
334 } else { 334 } else {
335 pipe_.reset(local_pipe.release()); 335 pipe_.reset(local_pipe.release());
336 } 336 }
337 return true; 337 return true;
338 } 338 }
339 339
340 bool ChannelPosix::Connect() { 340 bool ChannelPosix::Connect() {
341 OnConnect();
342
341 if (!server_listen_pipe_.is_valid() && !pipe_.is_valid()) { 343 if (!server_listen_pipe_.is_valid() && !pipe_.is_valid()) {
342 DLOG(WARNING) << "Channel creation failed: " << pipe_name_; 344 DLOG(WARNING) << "Channel creation failed: " << pipe_name_;
343 return false; 345 return false;
344 } 346 }
345 347
346 bool did_connect = true; 348 bool did_connect = true;
347 if (server_listen_pipe_.is_valid()) { 349 if (server_listen_pipe_.is_valid()) {
348 #if defined(OS_NACL_NONSFI) 350 #if defined(OS_NACL_NONSFI)
349 LOG(FATAL) << "IPC channels in nacl_helper_nonsfi " 351 LOG(FATAL) << "IPC channels in nacl_helper_nonsfi "
350 << "should always be in client mode."; 352 << "should always be in client mode.";
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 // static 1130 // static
1129 void Channel::SetGlobalPid(int pid) { 1131 void Channel::SetGlobalPid(int pid) {
1130 ChannelPosix::SetGlobalPid(pid); 1132 ChannelPosix::SetGlobalPid(pid);
1131 } 1133 }
1132 int Channel::GetGlobalPid() { 1134 int Channel::GetGlobalPid() {
1133 return ChannelPosix::GetGlobalPid(); 1135 return ChannelPosix::GetGlobalPid();
1134 } 1136 }
1135 #endif // OS_LINUX 1137 #endif // OS_LINUX
1136 1138
1137 } // namespace IPC 1139 } // namespace IPC
OLDNEW
« ipc/ipc_channel.h ('K') | « ipc/ipc_channel_nacl.cc ('k') | ipc/ipc_channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698