| 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 <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 RefPtr<Dispatcher> | 145 RefPtr<Dispatcher> |
| 146 WaitSetDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock( | 146 WaitSetDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock( |
| 147 MessagePipe* /*message_pipe*/, | 147 MessagePipe* /*message_pipe*/, |
| 148 unsigned /*port*/) { | 148 unsigned /*port*/) { |
| 149 mutex().AssertHeld(); | 149 mutex().AssertHeld(); |
| 150 NOTREACHED(); | 150 NOTREACHED(); |
| 151 return nullptr; | 151 return nullptr; |
| 152 } | 152 } |
| 153 | 153 |
| 154 MojoResult WaitSetDispatcher::WaitSetAddImpl( | 154 MojoResult WaitSetDispatcher::WaitSetAddImpl( |
| 155 UserPointer<const MojoWaitSetAddOptions> options, | |
| 156 RefPtr<Dispatcher>&& dispatcher, | 155 RefPtr<Dispatcher>&& dispatcher, |
| 157 MojoHandleSignals signals, | 156 MojoHandleSignals signals, |
| 158 uint64_t cookie) { | 157 uint64_t cookie, |
| 158 UserPointer<const MojoWaitSetAddOptions> options) { |
| 159 // This will be owned by |entries_|, so it should only be used under | 159 // This will be owned by |entries_|, so it should only be used under |
| 160 // |mutex()|. | 160 // |mutex()|. |
| 161 Entry* entry = nullptr; | 161 Entry* entry = nullptr; |
| 162 { | 162 { |
| 163 MutexLocker locker(&mutex()); | 163 MutexLocker locker(&mutex()); |
| 164 if (is_closed_no_lock()) | 164 if (is_closed_no_lock()) |
| 165 return MOJO_RESULT_INVALID_ARGUMENT; | 165 return MOJO_RESULT_INVALID_ARGUMENT; |
| 166 MojoWaitSetAddOptions validated_options; | 166 MojoWaitSetAddOptions validated_options; |
| 167 MojoResult result = ValidateWaitSetAddOptions(options, &validated_options); | 167 MojoResult result = ValidateWaitSetAddOptions(options, &validated_options); |
| 168 if (result != MOJO_RESULT_OK) | 168 if (result != MOJO_RESULT_OK) |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 } else { | 460 } else { |
| 461 entry->triggered_next->triggered_previous = entry->triggered_previous; | 461 entry->triggered_next->triggered_previous = entry->triggered_previous; |
| 462 } | 462 } |
| 463 | 463 |
| 464 entry->triggered_previous = nullptr; | 464 entry->triggered_previous = nullptr; |
| 465 entry->triggered_next = nullptr; | 465 entry->triggered_next = nullptr; |
| 466 } | 466 } |
| 467 | 467 |
| 468 } // namespace system | 468 } // namespace system |
| 469 } // namespace mojo | 469 } // namespace mojo |
| OLD | NEW |