OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 return dispatcher_result; | 52 return dispatcher_result; |
53 } | 53 } |
54 return result; | 54 return result; |
55 } | 55 } |
56 | 56 |
57 void CreateMessagePipe(scoped_refptr<MessagePipeDispatcher>* d0, | 57 void CreateMessagePipe(scoped_refptr<MessagePipeDispatcher>* d0, |
58 scoped_refptr<MessagePipeDispatcher>* d1) { | 58 scoped_refptr<MessagePipeDispatcher>* d1) { |
59 MojoHandle h0, h1; | 59 MojoHandle h0, h1; |
60 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateMessagePipe(nullptr, &h0, &h1)); | 60 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateMessagePipe(nullptr, &h0, &h1)); |
61 | 61 |
62 Core* core = mojo::edk::internal::GetCore(); | 62 Core* core = mojo::edk::internal::g_core; |
63 *d0 = scoped_refptr<MessagePipeDispatcher>( | 63 *d0 = scoped_refptr<MessagePipeDispatcher>( |
64 static_cast<MessagePipeDispatcher*>(core->GetDispatcher(h0).get())); | 64 static_cast<MessagePipeDispatcher*>(core->GetDispatcher(h0).get())); |
65 *d1 = scoped_refptr<MessagePipeDispatcher>( | 65 *d1 = scoped_refptr<MessagePipeDispatcher>( |
66 static_cast<MessagePipeDispatcher*>(core->GetDispatcher(h1).get())); | 66 static_cast<MessagePipeDispatcher*>(core->GetDispatcher(h1).get())); |
67 pipe_id_generator_++; | 67 pipe_id_generator_++; |
68 | 68 |
69 dispatchers_to_close_.push_back(*d0); | 69 dispatchers_to_close_.push_back(*d0); |
70 dispatchers_to_close_.push_back(*d1); | 70 dispatchers_to_close_.push_back(*d1); |
71 } | 71 } |
72 | 72 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 EXPECT_EQ(MOJO_RESULT_OK, | 458 EXPECT_EQ(MOJO_RESULT_OK, |
459 GetOneReadyDispatcher(wait_set, &woken_dispatcher, nullptr)); | 459 GetOneReadyDispatcher(wait_set, &woken_dispatcher, nullptr)); |
460 EXPECT_EQ(nested_wait_set, woken_dispatcher); | 460 EXPECT_EQ(nested_wait_set, woken_dispatcher); |
461 | 461 |
462 wait_set->RemoveAwakable(&w, nullptr); | 462 wait_set->RemoveAwakable(&w, nullptr); |
463 } | 463 } |
464 | 464 |
465 } // namespace | 465 } // namespace |
466 } // namespace edk | 466 } // namespace edk |
467 } // namespace mojo | 467 } // namespace mojo |
OLD | NEW |