| 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 #include "mojo/edk/system/core.h" | 5 #include "mojo/edk/system/core.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 { | 371 { |
| 372 base::AutoLock lock(handles_lock_); | 372 base::AutoLock lock(handles_lock_); |
| 373 MojoResult rv = handles_.GetAndRemoveDispatcher(handle, &dispatcher); | 373 MojoResult rv = handles_.GetAndRemoveDispatcher(handle, &dispatcher); |
| 374 if (rv != MOJO_RESULT_OK) | 374 if (rv != MOJO_RESULT_OK) |
| 375 return rv; | 375 return rv; |
| 376 } | 376 } |
| 377 dispatcher->Close(); | 377 dispatcher->Close(); |
| 378 return MOJO_RESULT_OK; | 378 return MOJO_RESULT_OK; |
| 379 } | 379 } |
| 380 | 380 |
| 381 MojoResult Core::QueryHandleSignalsState( | |
| 382 MojoHandle handle, | |
| 383 MojoHandleSignalsState* signals_state) { | |
| 384 RequestContext request_context; | |
| 385 scoped_refptr<Dispatcher> dispatcher = GetDispatcher(handle); | |
| 386 if (!dispatcher || !signals_state) | |
| 387 return MOJO_RESULT_INVALID_ARGUMENT; | |
| 388 *signals_state = dispatcher->GetHandleSignalsState(); | |
| 389 return MOJO_RESULT_OK; | |
| 390 } | |
| 391 | |
| 392 MojoResult Core::Wait(MojoHandle handle, | 381 MojoResult Core::Wait(MojoHandle handle, |
| 393 MojoHandleSignals signals, | 382 MojoHandleSignals signals, |
| 394 MojoDeadline deadline, | 383 MojoDeadline deadline, |
| 395 MojoHandleSignalsState* signals_state) { | 384 MojoHandleSignalsState* signals_state) { |
| 396 RequestContext request_context; | 385 RequestContext request_context; |
| 397 uint32_t unused = static_cast<uint32_t>(-1); | 386 uint32_t unused = static_cast<uint32_t>(-1); |
| 398 HandleSignalsState hss; | 387 HandleSignalsState hss; |
| 399 MojoResult rv = WaitManyInternal(&handle, &signals, 1, deadline, &unused, | 388 MojoResult rv = WaitManyInternal(&handle, &signals, 1, deadline, &unused, |
| 400 signals_state ? &hss : nullptr); | 389 signals_state ? &hss : nullptr); |
| 401 if (rv != MOJO_RESULT_INVALID_ARGUMENT && signals_state) | 390 if (rv != MOJO_RESULT_INVALID_ARGUMENT && signals_state) |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 std::unique_ptr<NodeController> node_controller) { | 1188 std::unique_ptr<NodeController> node_controller) { |
| 1200 // It's OK to leak this reference. At this point we know the IO loop is still | 1189 // It's OK to leak this reference. At this point we know the IO loop is still |
| 1201 // running, and we know the NodeController will observe its eventual | 1190 // running, and we know the NodeController will observe its eventual |
| 1202 // destruction. This tells the NodeController to delete itself when that | 1191 // destruction. This tells the NodeController to delete itself when that |
| 1203 // happens. | 1192 // happens. |
| 1204 node_controller.release()->DestroyOnIOThreadShutdown(); | 1193 node_controller.release()->DestroyOnIOThreadShutdown(); |
| 1205 } | 1194 } |
| 1206 | 1195 |
| 1207 } // namespace edk | 1196 } // namespace edk |
| 1208 } // namespace mojo | 1197 } // namespace mojo |
| OLD | NEW |