| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ipc/ipc_channel_handle.h" | 10 #include "ipc/ipc_channel_handle.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // Send a message over the Channel to the listener on the other end. | 139 // Send a message over the Channel to the listener on the other end. |
| 140 // | 140 // |
| 141 // |message| must be allocated using operator new. This object will be | 141 // |message| must be allocated using operator new. This object will be |
| 142 // deleted once the contents of the Message have been sent. | 142 // deleted once the contents of the Message have been sent. |
| 143 virtual bool Send(Message* message); | 143 virtual bool Send(Message* message); |
| 144 | 144 |
| 145 #if defined(OS_POSIX) && !defined(OS_NACL) | 145 #if defined(OS_POSIX) && !defined(OS_NACL) |
| 146 // On POSIX an IPC::Channel wraps a socketpair(), this method returns the | 146 // On POSIX an IPC::Channel wraps a socketpair(), this method returns the |
| 147 // FD # for the client end of the socket. | 147 // FD # for the client end of the socket. |
| 148 // This method may only be called on the server side of a channel. | 148 // This method may only be called on the server side of a channel. |
| 149 // This method can be called on any thread. |
| 149 int GetClientFileDescriptor() const; | 150 int GetClientFileDescriptor() const; |
| 150 | 151 |
| 152 // Same as GetClientFileDescriptor, but transfers the ownership of the |
| 153 // file descriptor to the caller. |
| 154 // This method can be called on any thread. |
| 155 int TakeClientFileDescriptor(); |
| 156 |
| 151 // On POSIX an IPC::Channel can either wrap an established socket, or it | 157 // On POSIX an IPC::Channel can either wrap an established socket, or it |
| 152 // can wrap a socket that is listening for connections. Currently an | 158 // can wrap a socket that is listening for connections. Currently an |
| 153 // IPC::Channel that listens for connections can only accept one connection | 159 // IPC::Channel that listens for connections can only accept one connection |
| 154 // at a time. | 160 // at a time. |
| 155 | 161 |
| 156 // Returns true if the channel supports listening for connections. | 162 // Returns true if the channel supports listening for connections. |
| 157 bool AcceptsConnections() const; | 163 bool AcceptsConnections() const; |
| 158 | 164 |
| 159 // Returns true if the channel supports listening for connections and is | 165 // Returns true if the channel supports listening for connections and is |
| 160 // currently connected. | 166 // currently connected. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 HELLO_MESSAGE_TYPE = kuint16max // Maximum value of message type (uint16), | 206 HELLO_MESSAGE_TYPE = kuint16max // Maximum value of message type (uint16), |
| 201 // to avoid conflicting with normal | 207 // to avoid conflicting with normal |
| 202 // message types, which are enumeration | 208 // message types, which are enumeration |
| 203 // constants starting from 0. | 209 // constants starting from 0. |
| 204 }; | 210 }; |
| 205 }; | 211 }; |
| 206 | 212 |
| 207 } // namespace IPC | 213 } // namespace IPC |
| 208 | 214 |
| 209 #endif // IPC_IPC_CHANNEL_H_ | 215 #endif // IPC_IPC_CHANNEL_H_ |
| OLD | NEW |