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

Side by Side Diff: ipc/ipc_channel_nacl.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, 7 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_common.cc ('k') | ipc/ipc_channel_posix.cc » ('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_nacl.h" 5 #include "ipc/ipc_channel_nacl.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // This shouldn't actually get used in the untrusted side of the proxy, and we 148 // This shouldn't actually get used in the untrusted side of the proxy, and we
149 // don't have the real pid anyway. 149 // don't have the real pid anyway.
150 return -1; 150 return -1;
151 } 151 }
152 152
153 base::ProcessId ChannelNacl::GetSelfPID() const { 153 base::ProcessId ChannelNacl::GetSelfPID() const {
154 return -1; 154 return -1;
155 } 155 }
156 156
157 bool ChannelNacl::Connect() { 157 bool ChannelNacl::Connect() {
158 WillConnect();
159
158 if (pipe_ == -1) { 160 if (pipe_ == -1) {
159 DLOG(WARNING) << "Channel creation failed: " << pipe_name_; 161 DLOG(WARNING) << "Channel creation failed: " << pipe_name_;
160 return false; 162 return false;
161 } 163 }
162 164
163 // Note that Connect is called on the "Channel" thread (i.e., the same thread 165 // Note that Connect is called on the "Channel" thread (i.e., the same thread
164 // where Channel::Send will be called, and the same thread that should receive 166 // where Channel::Send will be called, and the same thread that should receive
165 // messages). The constructor might be invoked on another thread (see 167 // messages). The constructor might be invoked on another thread (see
166 // ChannelProxy for an example of that). Therefore, we must wait until Connect 168 // ChannelProxy for an example of that). Therefore, we must wait until Connect
167 // is called to decide which SingleThreadTaskRunner to pass to 169 // is called to decide which SingleThreadTaskRunner to pass to
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 400
399 // static 401 // static
400 std::unique_ptr<Channel> Channel::Create( 402 std::unique_ptr<Channel> Channel::Create(
401 const IPC::ChannelHandle& channel_handle, 403 const IPC::ChannelHandle& channel_handle,
402 Mode mode, 404 Mode mode,
403 Listener* listener) { 405 Listener* listener) {
404 return base::WrapUnique(new ChannelNacl(channel_handle, mode, listener)); 406 return base::WrapUnique(new ChannelNacl(channel_handle, mode, listener));
405 } 407 }
406 408
407 } // namespace IPC 409 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_common.cc ('k') | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698