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 #ifndef IPC_IPC_CHANNEL_H_ | 5 #ifndef IPC_IPC_CHANNEL_H_ |
6 #define IPC_IPC_CHANNEL_H_ | 6 #define IPC_IPC_CHANNEL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #if defined(OS_POSIX) | 10 #if defined(OS_POSIX) |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // if your process has not yet processed the "hello" message from the remote | 166 // if your process has not yet processed the "hello" message from the remote |
167 // side, this will fail. You should either make sure calling this is either | 167 // side, this will fail. You should either make sure calling this is either |
168 // in response to a message from the remote side (which guarantees that it's | 168 // in response to a message from the remote side (which guarantees that it's |
169 // been connected), or you wait for the "connected" notification on the | 169 // been connected), or you wait for the "connected" notification on the |
170 // listener. | 170 // listener. |
171 virtual base::ProcessId GetPeerPID() const = 0; | 171 virtual base::ProcessId GetPeerPID() const = 0; |
172 | 172 |
173 // Get its own process id. This value is told to the peer. | 173 // Get its own process id. This value is told to the peer. |
174 virtual base::ProcessId GetSelfPID() const = 0; | 174 virtual base::ProcessId GetSelfPID() const = 0; |
175 | 175 |
176 // Return connected ChannelHandle which the channel has owned. | |
177 // This method transfers the ownership to the caller | |
178 // so the channel isn't valid after the call. | |
179 virtual ChannelHandle TakePipeHandle() WARN_UNUSED_RESULT = 0; | |
180 | |
181 // Send a message over the Channel to the listener on the other end. | 176 // Send a message over the Channel to the listener on the other end. |
182 // | 177 // |
183 // |message| must be allocated using operator new. This object will be | 178 // |message| must be allocated using operator new. This object will be |
184 // deleted once the contents of the Message have been sent. | 179 // deleted once the contents of the Message have been sent. |
185 virtual bool Send(Message* message) = 0; | 180 virtual bool Send(Message* message) = 0; |
186 | 181 |
187 #if defined(OS_POSIX) && !defined(OS_NACL) | 182 #if defined(OS_POSIX) && !defined(OS_NACL) |
188 // On POSIX an IPC::Channel wraps a socketpair(), this method returns the | 183 // On POSIX an IPC::Channel wraps a socketpair(), this method returns the |
189 // FD # for the client end of the socket. | 184 // FD # for the client end of the socket. |
190 // This method may only be called on the server side of a channel. | 185 // This method may only be called on the server side of a channel. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 226 |
232 #if defined(OS_POSIX) | 227 #if defined(OS_POSIX) |
233 // SocketPair() creates a pair of socket FDs suitable for using with | 228 // SocketPair() creates a pair of socket FDs suitable for using with |
234 // IPC::Channel. | 229 // IPC::Channel. |
235 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); | 230 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); |
236 #endif | 231 #endif |
237 | 232 |
238 } // namespace IPC | 233 } // namespace IPC |
239 | 234 |
240 #endif // IPC_IPC_CHANNEL_H_ | 235 #endif // IPC_IPC_CHANNEL_H_ |
OLD | NEW |