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 <stdint.h> | 9 #include <stdint.h> |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 broker_(broker) { | 134 broker_(broker) { |
135 if (!CreatePipe(channel_handle)) { | 135 if (!CreatePipe(channel_handle)) { |
136 // The pipe may have been closed already. | 136 // The pipe may have been closed already. |
137 const char *modestr = (mode_ & MODE_SERVER_FLAG) ? "server" : "client"; | 137 const char *modestr = (mode_ & MODE_SERVER_FLAG) ? "server" : "client"; |
138 LOG(WARNING) << "Unable to create pipe named \"" << channel_handle.name | 138 LOG(WARNING) << "Unable to create pipe named \"" << channel_handle.name |
139 << "\" in " << modestr << " mode"; | 139 << "\" in " << modestr << " mode"; |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 ChannelNacl::~ChannelNacl() { | 143 ChannelNacl::~ChannelNacl() { |
| 144 CleanUp(); |
144 Close(); | 145 Close(); |
145 } | 146 } |
146 | 147 |
147 base::ProcessId ChannelNacl::GetPeerPID() const { | 148 base::ProcessId ChannelNacl::GetPeerPID() const { |
148 // This shouldn't actually get used in the untrusted side of the proxy, and we | 149 // This shouldn't actually get used in the untrusted side of the proxy, and we |
149 // don't have the real pid anyway. | 150 // don't have the real pid anyway. |
150 return -1; | 151 return -1; |
151 } | 152 } |
152 | 153 |
153 base::ProcessId ChannelNacl::GetSelfPID() const { | 154 base::ProcessId ChannelNacl::GetSelfPID() const { |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 // static | 399 // static |
399 scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle, | 400 scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle, |
400 Mode mode, | 401 Mode mode, |
401 Listener* listener, | 402 Listener* listener, |
402 AttachmentBroker* broker) { | 403 AttachmentBroker* broker) { |
403 return scoped_ptr<Channel>( | 404 return scoped_ptr<Channel>( |
404 new ChannelNacl(channel_handle, mode, listener, broker)); | 405 new ChannelNacl(channel_handle, mode, listener, broker)); |
405 } | 406 } |
406 | 407 |
407 } // namespace IPC | 408 } // namespace IPC |
OLD | NEW |