| 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/waiter_test_utils.h" | 5 #include "mojo/edk/system/waiter_test_utils.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 using mojo::util::RefPtr; |
| 10 |
| 9 namespace mojo { | 11 namespace mojo { |
| 10 namespace system { | 12 namespace system { |
| 11 namespace test { | 13 namespace test { |
| 12 | 14 |
| 13 SimpleWaiterThread::SimpleWaiterThread(MojoResult* result, uint32_t* context) | 15 SimpleWaiterThread::SimpleWaiterThread(MojoResult* result, uint32_t* context) |
| 14 : result_(result), context_(context) { | 16 : result_(result), context_(context) { |
| 15 waiter_.Init(); | 17 waiter_.Init(); |
| 16 *result_ = 5420734; // Totally invalid result. | 18 *result_ = 5420734; // Totally invalid result. |
| 17 *context_ = 23489023; // "Random". | 19 *context_ = 23489023; // "Random". |
| 18 } | 20 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 return; | 64 return; |
| 63 | 65 |
| 64 *did_wait_out_ = true; | 66 *did_wait_out_ = true; |
| 65 *result_out_ = waiter_.Wait(deadline_, context_out_); | 67 *result_out_ = waiter_.Wait(deadline_, context_out_); |
| 66 dispatcher_->RemoveAwakable(&waiter_, signals_state_out_); | 68 dispatcher_->RemoveAwakable(&waiter_, signals_state_out_); |
| 67 } | 69 } |
| 68 | 70 |
| 69 } // namespace test | 71 } // namespace test |
| 70 } // namespace system | 72 } // namespace system |
| 71 } // namespace mojo | 73 } // namespace mojo |
| OLD | NEW |