| 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 |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/files/scoped_file.h" | 15 #include "base/files/scoped_file.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/process/process.h" | 17 #include "base/process/process.h" |
| 18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
| 19 #include "base/threading/thread_task_runner_handle.h" | 19 #include "base/threading/thread_task_runner_handle.h" |
| 20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #include "ipc/ipc_channel_handle.h" | 21 #include "ipc/ipc_channel_handle.h" |
| 22 #include "ipc/ipc_endpoint.h" | 22 #include "ipc/ipc_endpoint.h" |
| 23 #include "ipc/ipc_message.h" | 23 #include "ipc/ipc_message.h" |
| 24 #include "mojo/common/event.mojom.h" |
| 24 #include "mojo/public/cpp/bindings/associated_group.h" | 25 #include "mojo/public/cpp/bindings/associated_group.h" |
| 25 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" | 26 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
| 26 #include "mojo/public/cpp/bindings/associated_interface_request.h" | 27 #include "mojo/public/cpp/bindings/associated_interface_request.h" |
| 27 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" | 28 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" |
| 28 | 29 |
| 29 #if defined(OS_POSIX) | 30 #if defined(OS_POSIX) |
| 30 #include <sys/types.h> | 31 #include <sys/types.h> |
| 31 #endif | 32 #endif |
| 32 | 33 |
| 33 namespace IPC { | 34 namespace IPC { |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // NOTE: Not all implementations support this. | 260 // NOTE: Not all implementations support this. |
| 260 virtual AssociatedInterfaceSupport* GetAssociatedInterfaceSupport(); | 261 virtual AssociatedInterfaceSupport* GetAssociatedInterfaceSupport(); |
| 261 | 262 |
| 262 // Overridden from ipc::Sender. | 263 // Overridden from ipc::Sender. |
| 263 // Send a message over the Channel to the listener on the other end. | 264 // Send a message over the Channel to the listener on the other end. |
| 264 // | 265 // |
| 265 // |message| must be allocated using operator new. This object will be | 266 // |message| must be allocated using operator new. This object will be |
| 266 // deleted once the contents of the Message have been sent. | 267 // deleted once the contents of the Message have been sent. |
| 267 bool Send(Message* message) override = 0; | 268 bool Send(Message* message) override = 0; |
| 268 | 269 |
| 270 // Sends an Event pipe to the remote endpoint which will Signal() it |
| 271 // immediately upon receipt. This can be used to synchronize against the |
| 272 // Channel's message FIFO. |
| 273 virtual void SendEventToSignal(mojo::common::mojom::EventPtr event); |
| 274 |
| 269 // NaCl in Non-SFI mode runs on Linux directly, and the following functions | 275 // NaCl in Non-SFI mode runs on Linux directly, and the following functions |
| 270 // compiled on Linux are also needed. Please see also comments in | 276 // compiled on Linux are also needed. Please see also comments in |
| 271 // components/nacl_nonsfi.gyp for more details. | 277 // components/nacl_nonsfi.gyp for more details. |
| 272 #if defined(OS_POSIX) && !defined(OS_NACL_SFI) | 278 #if defined(OS_POSIX) && !defined(OS_NACL_SFI) |
| 273 // On POSIX an IPC::Channel wraps a socketpair(), this method returns the | 279 // On POSIX an IPC::Channel wraps a socketpair(), this method returns the |
| 274 // FD # for the client end of the socket. | 280 // FD # for the client end of the socket. |
| 275 // This method may only be called on the server side of a channel. | 281 // This method may only be called on the server side of a channel. |
| 276 // This method can be called on any thread. | 282 // This method can be called on any thread. |
| 277 virtual int GetClientFileDescriptor() const = 0; | 283 virtual int GetClientFileDescriptor() const = 0; |
| 278 | 284 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 363 |
| 358 #if defined(OS_POSIX) | 364 #if defined(OS_POSIX) |
| 359 // SocketPair() creates a pair of socket FDs suitable for using with | 365 // SocketPair() creates a pair of socket FDs suitable for using with |
| 360 // IPC::Channel. | 366 // IPC::Channel. |
| 361 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); | 367 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); |
| 362 #endif | 368 #endif |
| 363 | 369 |
| 364 } // namespace IPC | 370 } // namespace IPC |
| 365 | 371 |
| 366 #endif // IPC_IPC_CHANNEL_H_ | 372 #endif // IPC_IPC_CHANNEL_H_ |
| OLD | NEW |