| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <functional> | 10 #include <functional> |
| 11 | 11 |
| 12 #include "mojo/edk/system/entrypoint_class.h" | 12 #include "mojo/edk/system/entrypoint_class.h" |
| 13 #include "mojo/edk/system/handle.h" | 13 #include "mojo/edk/system/handle.h" |
| 14 #include "mojo/edk/system/handle_table.h" | 14 #include "mojo/edk/system/handle_table.h" |
| 15 #include "mojo/edk/system/mapping_table.h" | 15 #include "mojo/edk/system/mapping_table.h" |
| 16 #include "mojo/edk/system/memory.h" | 16 #include "mojo/edk/system/memory.h" |
| 17 #include "mojo/edk/util/mutex.h" | 17 #include "mojo/edk/util/mutex.h" |
| 18 #include "mojo/edk/util/ref_ptr.h" | 18 #include "mojo/edk/util/ref_ptr.h" |
| 19 #include "mojo/edk/util/thread_annotations.h" | 19 #include "mojo/edk/util/thread_annotations.h" |
| 20 #include "mojo/public/c/system/buffer.h" | 20 #include "mojo/public/c/system/buffer.h" |
| 21 #include "mojo/public/c/system/data_pipe.h" | 21 #include "mojo/public/c/system/data_pipe.h" |
| 22 #include "mojo/public/c/system/handle.h" | 22 #include "mojo/public/c/system/handle.h" |
| 23 #include "mojo/public/c/system/message_pipe.h" | 23 #include "mojo/public/c/system/message_pipe.h" |
| 24 #include "mojo/public/c/system/result.h" | 24 #include "mojo/public/c/system/result.h" |
| 25 #include "mojo/public/c/system/time.h" | 25 #include "mojo/public/c/system/time.h" |
| 26 #include "mojo/public/c/system/wait_set.h" |
| 26 #include "mojo/public/cpp/system/macros.h" | 27 #include "mojo/public/cpp/system/macros.h" |
| 27 | 28 |
| 28 namespace mojo { | 29 namespace mojo { |
| 29 | 30 |
| 30 namespace embedder { | 31 namespace embedder { |
| 31 class PlatformSupport; | 32 class PlatformSupport; |
| 32 } | 33 } |
| 33 | 34 |
| 34 namespace system { | 35 namespace system { |
| 35 | 36 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 MojoResult GetBufferInformation(MojoHandle buffer_handle, | 213 MojoResult GetBufferInformation(MojoHandle buffer_handle, |
| 213 UserPointer<MojoBufferInformation> info, | 214 UserPointer<MojoBufferInformation> info, |
| 214 uint32_t info_num_bytes); | 215 uint32_t info_num_bytes); |
| 215 MojoResult MapBuffer(MojoHandle buffer_handle, | 216 MojoResult MapBuffer(MojoHandle buffer_handle, |
| 216 uint64_t offset, | 217 uint64_t offset, |
| 217 uint64_t num_bytes, | 218 uint64_t num_bytes, |
| 218 UserPointer<void*> buffer, | 219 UserPointer<void*> buffer, |
| 219 MojoMapBufferFlags flags); | 220 MojoMapBufferFlags flags); |
| 220 MojoResult UnmapBuffer(UserPointer<void> buffer); | 221 MojoResult UnmapBuffer(UserPointer<void> buffer); |
| 221 | 222 |
| 223 // These methods correspond to the API functions defined in |
| 224 // "mojo/public/c/system/wait_set.h": |
| 225 MojoResult CreateWaitSet(UserPointer<const MojoCreateWaitSetOptions> options, |
| 226 UserPointer<MojoHandle> wait_set_handle); |
| 227 MojoResult WaitSetAdd(MojoHandle wait_set_handle, |
| 228 MojoHandle handle, |
| 229 MojoHandleSignals signals, |
| 230 uint64_t cookie, |
| 231 UserPointer<const MojoWaitSetAddOptions> options); |
| 232 MojoResult WaitSetRemove(MojoHandle wait_set_handle, uint64_t cookie); |
| 233 MojoResult WaitSetWait(MojoHandle wait_set_handle, |
| 234 MojoDeadline deadline, |
| 235 UserPointer<uint32_t> num_results, |
| 236 UserPointer<MojoWaitSetResult> results, |
| 237 UserPointer<uint32_t> max_results); |
| 238 |
| 222 private: | 239 private: |
| 223 friend bool internal::ShutdownCheckNoLeaks(Core*); | 240 friend bool internal::ShutdownCheckNoLeaks(Core*); |
| 224 | 241 |
| 225 // Internal implementation of |Wait()| and |WaitMany()|; doesn't do basic | 242 // Internal implementation of |Wait()| and |WaitMany()|; doesn't do basic |
| 226 // validation of arguments. |*result_index| is only set if the result (whether | 243 // validation of arguments. |*result_index| is only set if the result (whether |
| 227 // success or failure) applies to a specific handle, so its value should be | 244 // success or failure) applies to a specific handle, so its value should be |
| 228 // preinitialized to |static_cast<uint32_t>(-1)|. | 245 // preinitialized to |static_cast<uint32_t>(-1)|. |
| 229 MojoResult WaitManyInternal(const MojoHandle* handles, | 246 MojoResult WaitManyInternal(const MojoHandle* handles, |
| 230 const MojoHandleSignals* signals, | 247 const MojoHandleSignals* signals, |
| 231 uint32_t num_handles, | 248 uint32_t num_handles, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 243 util::Mutex mapping_table_mutex_; | 260 util::Mutex mapping_table_mutex_; |
| 244 MappingTable mapping_table_ MOJO_GUARDED_BY(mapping_table_mutex_); | 261 MappingTable mapping_table_ MOJO_GUARDED_BY(mapping_table_mutex_); |
| 245 | 262 |
| 246 MOJO_DISALLOW_COPY_AND_ASSIGN(Core); | 263 MOJO_DISALLOW_COPY_AND_ASSIGN(Core); |
| 247 }; | 264 }; |
| 248 | 265 |
| 249 } // namespace system | 266 } // namespace system |
| 250 } // namespace mojo | 267 } // namespace mojo |
| 251 | 268 |
| 252 #endif // MOJO_EDK_SYSTEM_CORE_H_ | 269 #endif // MOJO_EDK_SYSTEM_CORE_H_ |
| OLD | NEW |