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 CHROME_NACL_NACL_IPC_ADAPTER_H_ | 5 #ifndef CHROME_NACL_NACL_IPC_ADAPTER_H_ |
6 #define CHROME_NACL_NACL_IPC_ADAPTER_H_ | 6 #define CHROME_NACL_NACL_IPC_ADAPTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/files/scoped_file.h" |
15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
18 #include "base/memory/shared_memory.h" | 19 #include "base/memory/shared_memory.h" |
19 #include "base/pickle.h" | 20 #include "base/pickle.h" |
20 #include "base/synchronization/condition_variable.h" | 21 #include "base/synchronization/condition_variable.h" |
21 #include "base/synchronization/lock.h" | 22 #include "base/synchronization/lock.h" |
22 #include "base/task_runner.h" | 23 #include "base/task_runner.h" |
23 #include "ipc/ipc_listener.h" | 24 #include "ipc/ipc_listener.h" |
24 #include "ipc/ipc_platform_file.h" | 25 #include "ipc/ipc_platform_file.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 int BlockingReceive(NaClImcTypedMsgHdr* msg); | 100 int BlockingReceive(NaClImcTypedMsgHdr* msg); |
100 | 101 |
101 // Closes the IPC channel. | 102 // Closes the IPC channel. |
102 void CloseChannel(); | 103 void CloseChannel(); |
103 | 104 |
104 // Make a NaClDesc that refers to this NaClIPCAdapter. Note that the returned | 105 // Make a NaClDesc that refers to this NaClIPCAdapter. Note that the returned |
105 // NaClDesc is reference-counted, and a reference is returned. | 106 // NaClDesc is reference-counted, and a reference is returned. |
106 NaClDesc* MakeNaClDesc(); | 107 NaClDesc* MakeNaClDesc(); |
107 | 108 |
108 #if defined(OS_POSIX) | 109 #if defined(OS_POSIX) |
109 int TakeClientFileDescriptor(); | 110 base::ScopedFD TakeClientFileDescriptor(); |
110 #endif | 111 #endif |
111 | 112 |
112 // Listener implementation. | 113 // Listener implementation. |
113 virtual bool OnMessageReceived(const IPC::Message& message) override; | 114 virtual bool OnMessageReceived(const IPC::Message& message) override; |
114 virtual void OnChannelConnected(int32 peer_pid) override; | 115 virtual void OnChannelConnected(int32 peer_pid) override; |
115 virtual void OnChannelError() override; | 116 virtual void OnChannelError() override; |
116 | 117 |
117 typedef base::Callback<void(IPC::PlatformFileForTransit, base::FilePath)> | 118 typedef base::Callback<void(IPC::PlatformFileForTransit, base::FilePath)> |
118 ResolveFileTokenReplyCallback; | 119 ResolveFileTokenReplyCallback; |
119 | 120 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // To be accessed on the I/O thread (via task runner) only. | 216 // To be accessed on the I/O thread (via task runner) only. |
216 IOThreadData io_thread_data_; | 217 IOThreadData io_thread_data_; |
217 | 218 |
218 DISALLOW_COPY_AND_ASSIGN(NaClIPCAdapter); | 219 DISALLOW_COPY_AND_ASSIGN(NaClIPCAdapter); |
219 }; | 220 }; |
220 | 221 |
221 // Export TranslatePepperFileReadWriteOpenFlags for testing. | 222 // Export TranslatePepperFileReadWriteOpenFlags for testing. |
222 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags); | 223 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags); |
223 | 224 |
224 #endif // CHROME_NACL_NACL_IPC_ADAPTER_H_ | 225 #endif // CHROME_NACL_NACL_IPC_ADAPTER_H_ |
OLD | NEW |