OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_NACL_LOADER_NACL_IPC_ADAPTER_H_ | 5 #ifndef COMPONENTS_NACL_LOADER_NACL_IPC_ADAPTER_H_ |
6 #define COMPONENTS_NACL_LOADER_NACL_IPC_ADAPTER_H_ | 6 #define COMPONENTS_NACL_LOADER_NACL_IPC_ADAPTER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "base/synchronization/lock.h" | 22 #include "base/synchronization/lock.h" |
23 #include "base/task_runner.h" | 23 #include "base/task_runner.h" |
24 #include "build/build_config.h" | 24 #include "build/build_config.h" |
25 #include "ipc/ipc_listener.h" | 25 #include "ipc/ipc_listener.h" |
26 #include "ipc/ipc_platform_file.h" | 26 #include "ipc/ipc_platform_file.h" |
27 #include "ppapi/c/pp_stdint.h" | 27 #include "ppapi/c/pp_stdint.h" |
28 #include "ppapi/proxy/nacl_message_scanner.h" | 28 #include "ppapi/proxy/nacl_message_scanner.h" |
29 | 29 |
30 struct NaClDesc; | 30 struct NaClDesc; |
31 struct NaClImcTypedMsgHdr; | 31 struct NaClImcTypedMsgHdr; |
32 struct PP_Size; | |
33 | 32 |
34 namespace base { | 33 namespace base { |
35 class SingleThreadTaskRunner; | 34 class SingleThreadTaskRunner; |
36 } | 35 } |
37 | 36 |
38 namespace IPC { | 37 namespace IPC { |
39 class Channel; | 38 class Channel; |
40 struct ChannelHandle; | 39 struct ChannelHandle; |
41 } | 40 } |
42 | 41 |
43 namespace ppapi { | |
44 class HostResource; | |
45 } | |
46 | |
47 // Adapts a Chrome IPC channel to an IPC channel that we expose to Native | 42 // Adapts a Chrome IPC channel to an IPC channel that we expose to Native |
48 // Client. This provides a mapping in both directions, so when IPC messages | 43 // Client. This provides a mapping in both directions, so when IPC messages |
49 // come in from another process, we rewrite them and allow them to be received | 44 // come in from another process, we rewrite them and allow them to be received |
50 // via a recvmsg-like interface in the NaCl code. When NaCl code calls sendmsg, | 45 // via a recvmsg-like interface in the NaCl code. When NaCl code calls sendmsg, |
51 // we implement that as sending IPC messages on the channel. | 46 // we implement that as sending IPC messages on the channel. |
52 // | 47 // |
53 // This object also provides the necessary logic for rewriting IPC messages. | 48 // This object also provides the necessary logic for rewriting IPC messages. |
54 // NaCl code is platform-independent and runs in a Posix-like enviroment, but | 49 // NaCl code is platform-independent and runs in a Posix-like enviroment, but |
55 // some formatting in the message and the way handles are transferred varies | 50 // some formatting in the message and the way handles are transferred varies |
56 // by platform. This class bridges that gap to provide what looks like a | 51 // by platform. This class bridges that gap to provide what looks like a |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 // To be accessed on the I/O thread (via task runner) only. | 226 // To be accessed on the I/O thread (via task runner) only. |
232 IOThreadData io_thread_data_; | 227 IOThreadData io_thread_data_; |
233 | 228 |
234 DISALLOW_COPY_AND_ASSIGN(NaClIPCAdapter); | 229 DISALLOW_COPY_AND_ASSIGN(NaClIPCAdapter); |
235 }; | 230 }; |
236 | 231 |
237 // Export TranslatePepperFileReadWriteOpenFlags for testing. | 232 // Export TranslatePepperFileReadWriteOpenFlags for testing. |
238 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags); | 233 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags); |
239 | 234 |
240 #endif // COMPONENTS_NACL_LOADER_NACL_IPC_ADAPTER_H_ | 235 #endif // COMPONENTS_NACL_LOADER_NACL_IPC_ADAPTER_H_ |
OLD | NEW |