| 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_DISPATCHER_H_ | 5 #ifndef MOJO_EDK_SYSTEM_DISPATCHER_H_ |
| 6 #define MOJO_EDK_SYSTEM_DISPATCHER_H_ | 6 #define MOJO_EDK_SYSTEM_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 util::RefPtr<Dispatcher>* new_dispatcher); | 163 util::RefPtr<Dispatcher>* new_dispatcher); |
| 164 MojoResult GetBufferInformation(UserPointer<MojoBufferInformation> info, | 164 MojoResult GetBufferInformation(UserPointer<MojoBufferInformation> info, |
| 165 uint32_t info_num_bytes); | 165 uint32_t info_num_bytes); |
| 166 MojoResult MapBuffer( | 166 MojoResult MapBuffer( |
| 167 uint64_t offset, | 167 uint64_t offset, |
| 168 uint64_t num_bytes, | 168 uint64_t num_bytes, |
| 169 MojoMapBufferFlags flags, | 169 MojoMapBufferFlags flags, |
| 170 std::unique_ptr<platform::PlatformSharedBufferMapping>* mapping); | 170 std::unique_ptr<platform::PlatformSharedBufferMapping>* mapping); |
| 171 | 171 |
| 172 // |EntrypointClass::WAIT_SET|: | 172 // |EntrypointClass::WAIT_SET|: |
| 173 MojoResult WaitSetAdd(UserPointer<const MojoWaitSetAddOptions> options, | 173 MojoResult WaitSetAdd(util::RefPtr<Dispatcher>&& dispatcher, |
| 174 util::RefPtr<Dispatcher>&& dispatcher, | |
| 175 MojoHandleSignals signals, | 174 MojoHandleSignals signals, |
| 176 uint64_t cookie); | 175 uint64_t cookie, |
| 176 UserPointer<const MojoWaitSetAddOptions> options); |
| 177 MojoResult WaitSetRemove(uint64_t cookie); | 177 MojoResult WaitSetRemove(uint64_t cookie); |
| 178 // Note: This will likely block the calling thread (so, e.g., no mutexes | 178 // Note: This will likely block the calling thread (so, e.g., no mutexes |
| 179 // should be held when it's called). | 179 // should be held when it's called). |
| 180 MojoResult WaitSetWait(MojoDeadline deadline, | 180 MojoResult WaitSetWait(MojoDeadline deadline, |
| 181 UserPointer<uint32_t> num_results, | 181 UserPointer<uint32_t> num_results, |
| 182 UserPointer<MojoWaitSetResult> results, | 182 UserPointer<MojoWaitSetResult> results, |
| 183 UserPointer<uint32_t> max_results); | 183 UserPointer<uint32_t> max_results); |
| 184 | 184 |
| 185 // Gets the current handle signals state. (The default implementation simply | 185 // Gets the current handle signals state. (The default implementation simply |
| 186 // returns a default-constructed |HandleSignalsState|, i.e., no signals | 186 // returns a default-constructed |HandleSignalsState|, i.e., no signals |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 uint64_t offset, | 380 uint64_t offset, |
| 381 uint64_t num_bytes, | 381 uint64_t num_bytes, |
| 382 MojoMapBufferFlags flags, | 382 MojoMapBufferFlags flags, |
| 383 std::unique_ptr<platform::PlatformSharedBufferMapping>* mapping) | 383 std::unique_ptr<platform::PlatformSharedBufferMapping>* mapping) |
| 384 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); | 384 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); |
| 385 // WARNING: Unlike the others, the following wait set methods are *not* called | 385 // WARNING: Unlike the others, the following wait set methods are *not* called |
| 386 // under |mutex_| and |is_closed_| is *not* checked. Thus any override must | 386 // under |mutex_| and |is_closed_| is *not* checked. Thus any override must |
| 387 // lock |mutex()| and check |is_closed_no_lock()| (returning | 387 // lock |mutex()| and check |is_closed_no_lock()| (returning |
| 388 // |MOJO_RESULT_INVALID_ARGUMENT| if it is true). | 388 // |MOJO_RESULT_INVALID_ARGUMENT| if it is true). |
| 389 virtual MojoResult WaitSetAddImpl( | 389 virtual MojoResult WaitSetAddImpl( |
| 390 UserPointer<const MojoWaitSetAddOptions> options, | |
| 391 util::RefPtr<Dispatcher>&& dispatcher, | 390 util::RefPtr<Dispatcher>&& dispatcher, |
| 392 MojoHandleSignals signals, | 391 MojoHandleSignals signals, |
| 393 uint64_t cookie); | 392 uint64_t cookie, |
| 393 UserPointer<const MojoWaitSetAddOptions> options); |
| 394 virtual MojoResult WaitSetRemoveImpl(uint64_t cookie); | 394 virtual MojoResult WaitSetRemoveImpl(uint64_t cookie); |
| 395 virtual MojoResult WaitSetWaitImpl(MojoDeadline deadline, | 395 virtual MojoResult WaitSetWaitImpl(MojoDeadline deadline, |
| 396 UserPointer<uint32_t> num_results, | 396 UserPointer<uint32_t> num_results, |
| 397 UserPointer<MojoWaitSetResult> results, | 397 UserPointer<MojoWaitSetResult> results, |
| 398 UserPointer<uint32_t> max_results); | 398 UserPointer<uint32_t> max_results); |
| 399 virtual HandleSignalsState GetHandleSignalsStateImplNoLock() const | 399 virtual HandleSignalsState GetHandleSignalsStateImplNoLock() const |
| 400 MOJO_SHARED_LOCKS_REQUIRED(mutex_); | 400 MOJO_SHARED_LOCKS_REQUIRED(mutex_); |
| 401 virtual MojoResult AddAwakableImplNoLock(Awakable* awakable, | 401 virtual MojoResult AddAwakableImplNoLock(Awakable* awakable, |
| 402 uint64_t context, | 402 uint64_t context, |
| 403 bool persistent, | 403 bool persistent, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 | 514 |
| 515 // So logging macros and |DCHECK_EQ()|, etc. work. | 515 // So logging macros and |DCHECK_EQ()|, etc. work. |
| 516 inline std::ostream& operator<<(std::ostream& out, Dispatcher::Type type) { | 516 inline std::ostream& operator<<(std::ostream& out, Dispatcher::Type type) { |
| 517 return out << static_cast<int>(type); | 517 return out << static_cast<int>(type); |
| 518 } | 518 } |
| 519 | 519 |
| 520 } // namespace system | 520 } // namespace system |
| 521 } // namespace mojo | 521 } // namespace mojo |
| 522 | 522 |
| 523 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ | 523 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ |
| OLD | NEW |