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 MOJO_EDK_SYSTEM_CORE_H_ | 5 #ifndef MOJO_EDK_SYSTEM_CORE_H_ |
6 #define MOJO_EDK_SYSTEM_CORE_H_ | 6 #define MOJO_EDK_SYSTEM_CORE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/shared_memory_handle.h" | 14 #include "base/memory/shared_memory_handle.h" |
15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
16 #include "base/task_runner.h" | 16 #include "base/task_runner.h" |
17 #include "mojo/edk/embedder/scoped_platform_handle.h" | 17 #include "mojo/edk/embedder/scoped_platform_handle.h" |
18 #include "mojo/edk/system/dispatcher.h" | 18 #include "mojo/edk/system/dispatcher.h" |
19 #include "mojo/edk/system/handle_signals_state.h" | 19 #include "mojo/edk/system/handle_signals_state.h" |
20 #include "mojo/edk/system/handle_table.h" | 20 #include "mojo/edk/system/handle_table.h" |
21 #include "mojo/edk/system/mapping_table.h" | 21 #include "mojo/edk/system/mapping_table.h" |
22 #include "mojo/edk/system/node_controller.h" | 22 #include "mojo/edk/system/node_controller.h" |
23 #include "mojo/edk/system/system_impl_export.h" | 23 #include "mojo/edk/system/system_impl_export.h" |
24 #include "mojo/public/c/system/buffer.h" | 24 #include "mojo/public/c/system/buffer.h" |
25 #include "mojo/public/c/system/data_pipe.h" | 25 #include "mojo/public/c/system/data_pipe.h" |
26 #include "mojo/public/c/system/message_pipe.h" | 26 #include "mojo/public/c/system/message_pipe.h" |
| 27 #include "mojo/public/c/system/platform_handle.h" |
27 #include "mojo/public/c/system/types.h" | 28 #include "mojo/public/c/system/types.h" |
28 #include "mojo/public/cpp/system/message_pipe.h" | 29 #include "mojo/public/cpp/system/message_pipe.h" |
29 | 30 |
30 namespace base { | 31 namespace base { |
31 class PortProvider; | 32 class PortProvider; |
32 } | 33 } |
33 | 34 |
34 namespace mojo { | 35 namespace mojo { |
35 namespace edk { | 36 namespace edk { |
36 | 37 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 MojoHandle buffer_handle, | 233 MojoHandle buffer_handle, |
233 const MojoDuplicateBufferHandleOptions* options, | 234 const MojoDuplicateBufferHandleOptions* options, |
234 MojoHandle* new_buffer_handle); | 235 MojoHandle* new_buffer_handle); |
235 MojoResult MapBuffer(MojoHandle buffer_handle, | 236 MojoResult MapBuffer(MojoHandle buffer_handle, |
236 uint64_t offset, | 237 uint64_t offset, |
237 uint64_t num_bytes, | 238 uint64_t num_bytes, |
238 void** buffer, | 239 void** buffer, |
239 MojoMapBufferFlags flags); | 240 MojoMapBufferFlags flags); |
240 MojoResult UnmapBuffer(void* buffer); | 241 MojoResult UnmapBuffer(void* buffer); |
241 | 242 |
| 243 // These methods correspond to the API functions defined in |
| 244 // "mojo/public/c/system/platform_handle.h". |
| 245 MojoResult WrapPlatformHandle(const MojoPlatformHandle* platform_handle, |
| 246 MojoHandle* mojo_handle); |
| 247 MojoResult UnwrapPlatformHandle(MojoHandle mojo_handle, |
| 248 MojoPlatformHandle* platform_handle); |
| 249 MojoResult WrapPlatformSharedBufferHandle( |
| 250 const MojoPlatformHandle* platform_handle, |
| 251 size_t size, |
| 252 MojoPlatformSharedBufferHandleFlags flags, |
| 253 MojoHandle* mojo_handle); |
| 254 MojoResult UnwrapPlatformSharedBufferHandle( |
| 255 MojoHandle mojo_handle, |
| 256 MojoPlatformHandle* platform_handle, |
| 257 size_t* size, |
| 258 MojoPlatformSharedBufferHandleFlags* flags); |
| 259 |
242 void GetActiveHandlesForTest(std::vector<MojoHandle>* handles); | 260 void GetActiveHandlesForTest(std::vector<MojoHandle>* handles); |
243 | 261 |
244 private: | 262 private: |
245 MojoResult WaitManyInternal(const MojoHandle* handles, | 263 MojoResult WaitManyInternal(const MojoHandle* handles, |
246 const MojoHandleSignals* signals, | 264 const MojoHandleSignals* signals, |
247 uint32_t num_handles, | 265 uint32_t num_handles, |
248 MojoDeadline deadline, | 266 MojoDeadline deadline, |
249 uint32_t *result_index, | 267 uint32_t *result_index, |
250 HandleSignalsState* signals_states); | 268 HandleSignalsState* signals_states); |
251 | 269 |
(...skipping 22 matching lines...) Expand all Loading... |
274 base::Lock mapping_table_lock_; // Protects |mapping_table_|. | 292 base::Lock mapping_table_lock_; // Protects |mapping_table_|. |
275 MappingTable mapping_table_; | 293 MappingTable mapping_table_; |
276 | 294 |
277 DISALLOW_COPY_AND_ASSIGN(Core); | 295 DISALLOW_COPY_AND_ASSIGN(Core); |
278 }; | 296 }; |
279 | 297 |
280 } // namespace edk | 298 } // namespace edk |
281 } // namespace mojo | 299 } // namespace mojo |
282 | 300 |
283 #endif // MOJO_EDK_SYSTEM_CORE_H_ | 301 #endif // MOJO_EDK_SYSTEM_CORE_H_ |
OLD | NEW |