| 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 <stddef.h> | 8 #include <stddef.h> | 
| 9 #include <stdint.h> | 9 #include <stdint.h> | 
| 10 | 10 | 
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 215   // Connect the pipe.  On the server side, this will initiate | 215   // Connect the pipe.  On the server side, this will initiate | 
| 216   // waiting for connections.  On the client, it attempts to | 216   // waiting for connections.  On the client, it attempts to | 
| 217   // connect to a pre-existing pipe.  Note, calling Connect() | 217   // connect to a pre-existing pipe.  Note, calling Connect() | 
| 218   // will not block the calling thread and may complete | 218   // will not block the calling thread and may complete | 
| 219   // asynchronously. | 219   // asynchronously. | 
| 220   // | 220   // | 
| 221   // The subclass implementation must call WillConnect() at the beginning of its | 221   // The subclass implementation must call WillConnect() at the beginning of its | 
| 222   // implementation. | 222   // implementation. | 
| 223   virtual bool Connect() WARN_UNUSED_RESULT = 0; | 223   virtual bool Connect() WARN_UNUSED_RESULT = 0; | 
| 224 | 224 | 
| 225   // Similar to (and exclusive to) Connect() above, but blocks outgoing messages | 225   // Pause the channel. Subsequent sends will be queued internally until | 
| 226   // until a future call to Unpause(). | 226   // Unpause() is called and the channel is flushed either by Unpause() or a | 
| 227   // | 227   // subsequent call to Flush(). | 
| 228   // Not all implementations support ConnectPaused(). Note that this interface | 228   virtual void Pause(); | 
| 229   // exists only to facilitate weird behavior where some Channel consumers want |  | 
| 230   // to force some early messages to be transmitted before ones which were sent |  | 
| 231   // earlier. This allows that to be done without the consumer implementing |  | 
| 232   // their own message queueing support which may be incompatible with the |  | 
| 233   // Channel's internal queueing behavior. |  | 
| 234   virtual bool ConnectPaused() WARN_UNUSED_RESULT; |  | 
| 235 | 229 | 
| 236   // Unpause the pipe. This allows subsequent Send() calls to transmit messages | 230   // Unpause the channel. This allows subsequent Send() calls to transmit | 
| 237   // immediately, without queueing. If |flush| is true, any messages queued | 231   // messages immediately, without queueing. If |flush| is true, any messages | 
| 238   // while paused will be flushed immediately upon unpausing. Otherwise you must | 232   // queued while paused will be flushed immediately upon unpausing. Otherwise | 
| 239   // call Flush() explicitly. | 233   // you must call Flush() explicitly. | 
| 240   // | 234   // | 
| 241   // Not all implementations support Unpause(). See ConnectPaused() above for | 235   // Not all implementations support Unpause(). See ConnectPaused() above for | 
| 242   // details. | 236   // details. | 
| 243   virtual void Unpause(bool flush); | 237   virtual void Unpause(bool flush); | 
| 244 | 238 | 
| 245   // Manually flush the pipe. This is only useful exactly once, and only after | 239   // Manually flush the pipe. This is only useful exactly once, and only after | 
| 246   // a call to Unpause(false), in order to explicitly flush out any | 240   // a call to Unpause(false), in order to explicitly flush out any | 
| 247   // messages which were queued prior to unpausing. | 241   // messages which were queued prior to unpausing. | 
| 248   // | 242   // | 
| 249   // Not all implementations support Flush(). See ConnectPaused() above for | 243   // Not all implementations support Flush(). See ConnectPaused() above for | 
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 368 | 362 | 
| 369 #if defined(OS_POSIX) | 363 #if defined(OS_POSIX) | 
| 370 // SocketPair() creates a pair of socket FDs suitable for using with | 364 // SocketPair() creates a pair of socket FDs suitable for using with | 
| 371 // IPC::Channel. | 365 // IPC::Channel. | 
| 372 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); | 366 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); | 
| 373 #endif | 367 #endif | 
| 374 | 368 | 
| 375 }  // namespace IPC | 369 }  // namespace IPC | 
| 376 | 370 | 
| 377 #endif  // IPC_IPC_CHANNEL_H_ | 371 #endif  // IPC_IPC_CHANNEL_H_ | 
| OLD | NEW | 
|---|