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

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: Rebase (scoped_ptr->std::unique_ptr) 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
« no previous file with comments | « ipc/ipc_channel_nacl.cc ('k') | ipc/ipc_channel_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « 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