| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "mojo/edk/system/wait_set_dispatcher.h" | 5 #include "mojo/edk/system/wait_set_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/edk/system/options_validation.h" | 8 #include "mojo/edk/system/options_validation.h" |
| 9 | 9 |
| 10 using mojo::util::MutexLocker; | 10 using mojo::util::MutexLocker; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 RefPtr<Dispatcher> | 66 RefPtr<Dispatcher> |
| 67 WaitSetDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock( | 67 WaitSetDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock( |
| 68 MessagePipe* /*message_pipe*/, | 68 MessagePipe* /*message_pipe*/, |
| 69 unsigned /*port*/) { | 69 unsigned /*port*/) { |
| 70 mutex().AssertHeld(); | 70 mutex().AssertHeld(); |
| 71 NOTREACHED(); | 71 NOTREACHED(); |
| 72 return nullptr; | 72 return nullptr; |
| 73 } | 73 } |
| 74 | 74 |
| 75 MojoResult WaitSetDispatcher::WaitSetAddImplNoLock( | 75 MojoResult WaitSetDispatcher::WaitSetAddImpl( |
| 76 UserPointer<const MojoWaitSetAddOptions> options, | 76 UserPointer<const MojoWaitSetAddOptions> options, |
| 77 Handle&& handle, | 77 Handle&& handle, |
| 78 MojoHandleSignals signals, | 78 MojoHandleSignals signals, |
| 79 uint64_t cookie) { | 79 uint64_t cookie) { |
| 80 mutex().AssertHeld(); | 80 MutexLocker locker(&mutex()); |
| 81 if (is_closed_no_lock()) |
| 82 return MOJO_RESULT_INVALID_ARGUMENT; |
| 81 | 83 |
| 82 // TODO(vtl) | 84 // TODO(vtl) |
| 83 NOTIMPLEMENTED(); | 85 NOTIMPLEMENTED(); |
| 84 return MOJO_RESULT_UNIMPLEMENTED; | 86 return MOJO_RESULT_UNIMPLEMENTED; |
| 85 } | 87 } |
| 86 | 88 |
| 87 MojoResult WaitSetDispatcher::WaitSetRemoveImplNoLock(uint64_t cookie) { | 89 MojoResult WaitSetDispatcher::WaitSetRemoveImpl(uint64_t cookie) { |
| 88 mutex().AssertHeld(); | 90 MutexLocker locker(&mutex()); |
| 91 if (is_closed_no_lock()) |
| 92 return MOJO_RESULT_INVALID_ARGUMENT; |
| 89 | 93 |
| 90 // TODO(vtl) | 94 // TODO(vtl) |
| 91 NOTIMPLEMENTED(); | 95 NOTIMPLEMENTED(); |
| 92 return MOJO_RESULT_UNIMPLEMENTED; | 96 return MOJO_RESULT_UNIMPLEMENTED; |
| 93 } | 97 } |
| 94 | 98 |
| 95 MojoResult WaitSetDispatcher::WaitSetWaitImpl( | 99 MojoResult WaitSetDispatcher::WaitSetWaitImpl( |
| 96 MojoDeadline deadline, | 100 MojoDeadline deadline, |
| 97 UserPointer<uint32_t> num_results, | 101 UserPointer<uint32_t> num_results, |
| 98 UserPointer<MojoWaitSetResult> results, | 102 UserPointer<MojoWaitSetResult> results, |
| 99 UserPointer<uint32_t> max_results) { | 103 UserPointer<uint32_t> max_results) { |
| 100 MutexLocker locker(&mutex()); | 104 MutexLocker locker(&mutex()); |
| 101 if (is_closed_no_lock()) | 105 if (is_closed_no_lock()) |
| 102 return MOJO_RESULT_INVALID_ARGUMENT; | 106 return MOJO_RESULT_INVALID_ARGUMENT; |
| 103 | 107 |
| 104 // TODO(vtl) | 108 // TODO(vtl) |
| 105 NOTIMPLEMENTED(); | 109 NOTIMPLEMENTED(); |
| 106 return MOJO_RESULT_UNIMPLEMENTED; | 110 return MOJO_RESULT_UNIMPLEMENTED; |
| 107 } | 111 } |
| 108 | 112 |
| 109 } // namespace system | 113 } // namespace system |
| 110 } // namespace mojo | 114 } // namespace mojo |
| OLD | NEW |