| 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_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 <sys/types.h> | 9 #include <sys/types.h> |
| 10 | 10 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 ChannelNacl::~ChannelNacl() { | 138 ChannelNacl::~ChannelNacl() { |
| 139 Close(); | 139 Close(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 base::ProcessId ChannelNacl::GetPeerPID() const { | 142 base::ProcessId ChannelNacl::GetPeerPID() const { |
| 143 // This shouldn't actually get used in the untrusted side of the proxy, and we | 143 // This shouldn't actually get used in the untrusted side of the proxy, and we |
| 144 // don't have the real pid anyway. | 144 // don't have the real pid anyway. |
| 145 return -1; | 145 return -1; |
| 146 } | 146 } |
| 147 | 147 |
| 148 base::ProcessId ChannelNacl::GetSelfPID() const { |
| 149 return -1; |
| 150 } |
| 151 |
| 152 ChannelHandle ChannelNacl::TakePipeHandle() { |
| 153 // NACL doesn't have any platform-level handles. |
| 154 return ChannelHandle(); |
| 155 } |
| 156 |
| 148 bool ChannelNacl::Connect() { | 157 bool ChannelNacl::Connect() { |
| 149 if (pipe_ == -1) { | 158 if (pipe_ == -1) { |
| 150 DLOG(WARNING) << "Channel creation failed: " << pipe_name_; | 159 DLOG(WARNING) << "Channel creation failed: " << pipe_name_; |
| 151 return false; | 160 return false; |
| 152 } | 161 } |
| 153 | 162 |
| 154 // Note that Connect is called on the "Channel" thread (i.e., the same thread | 163 // Note that Connect is called on the "Channel" thread (i.e., the same thread |
| 155 // where Channel::Send will be called, and the same thread that should receive | 164 // where Channel::Send will be called, and the same thread that should receive |
| 156 // messages). The constructor might be invoked on another thread (see | 165 // messages). The constructor might be invoked on another thread (see |
| 157 // ChannelProxy for an example of that). Therefore, we must wait until Connect | 166 // ChannelProxy for an example of that). Therefore, we must wait until Connect |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 // Channel's methods | 377 // Channel's methods |
| 369 | 378 |
| 370 // static | 379 // static |
| 371 scoped_ptr<Channel> Channel::Create( | 380 scoped_ptr<Channel> Channel::Create( |
| 372 const IPC::ChannelHandle &channel_handle, Mode mode, Listener* listener) { | 381 const IPC::ChannelHandle &channel_handle, Mode mode, Listener* listener) { |
| 373 return scoped_ptr<Channel>( | 382 return scoped_ptr<Channel>( |
| 374 new ChannelNacl(channel_handle, mode, listener)); | 383 new ChannelNacl(channel_handle, mode, listener)); |
| 375 } | 384 } |
| 376 | 385 |
| 377 } // namespace IPC | 386 } // namespace IPC |
| OLD | NEW |