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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Overridden from ipc::Sender. | 176 // Overridden from ipc::Sender. |
177 // Send a message over the Channel to the listener on the other end. | 177 // Send a message over the Channel to the listener on the other end. |
178 // | 178 // |
179 // |message| must be allocated using operator new. This object will be | 179 // |message| must be allocated using operator new. This object will be |
180 // deleted once the contents of the Message have been sent. | 180 // deleted once the contents of the Message have been sent. |
181 virtual bool Send(Message* message) override = 0; | 181 virtual bool Send(Message* message) override = 0; |
182 | 182 |
| 183 // True for a particular |Channel| subclass that allows non-IO threads call |
| 184 // |Send()|. The return value must be constant across the lifetime. |
| 185 virtual bool IsSendThreadSafe() const; |
| 186 |
183 // NaCl in Non-SFI mode runs on Linux directly, and the following functions | 187 // NaCl in Non-SFI mode runs on Linux directly, and the following functions |
184 // compiled on Linux are also needed. Please see also comments in | 188 // compiled on Linux are also needed. Please see also comments in |
185 // components/nacl_nonsfi.gyp for more details. | 189 // components/nacl_nonsfi.gyp for more details. |
186 #if defined(OS_POSIX) && !defined(OS_NACL_SFI) | 190 #if defined(OS_POSIX) && !defined(OS_NACL_SFI) |
187 // On POSIX an IPC::Channel wraps a socketpair(), this method returns the | 191 // On POSIX an IPC::Channel wraps a socketpair(), this method returns the |
188 // FD # for the client end of the socket. | 192 // FD # for the client end of the socket. |
189 // This method may only be called on the server side of a channel. | 193 // This method may only be called on the server side of a channel. |
190 // This method can be called on any thread. | 194 // This method can be called on any thread. |
191 virtual int GetClientFileDescriptor() const = 0; | 195 virtual int GetClientFileDescriptor() const = 0; |
192 | 196 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 234 |
231 #if defined(OS_POSIX) | 235 #if defined(OS_POSIX) |
232 // SocketPair() creates a pair of socket FDs suitable for using with | 236 // SocketPair() creates a pair of socket FDs suitable for using with |
233 // IPC::Channel. | 237 // IPC::Channel. |
234 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); | 238 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); |
235 #endif | 239 #endif |
236 | 240 |
237 } // namespace IPC | 241 } // namespace IPC |
238 | 242 |
239 #endif // IPC_IPC_CHANNEL_H_ | 243 #endif // IPC_IPC_CHANNEL_H_ |
OLD | NEW |