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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 ScopedInterfaceEndpointHandle handle = ptr_info.PassHandle(); | 106 ScopedInterfaceEndpointHandle handle = ptr_info.PassHandle(); |
107 CHECK(!handle.is_local()); | 107 CHECK(!handle.is_local()); |
108 return AssociatedInterfacePtrInfo<T>( | 108 return AssociatedInterfacePtrInfo<T>( |
109 target->CreateLocalEndpointHandle(handle.release()), | 109 target->CreateLocalEndpointHandle(handle.release()), |
110 ptr_info.version()); | 110 ptr_info.version()); |
111 } | 111 } |
112 | 112 |
113 void CreateRouterPair(scoped_refptr<MultiplexRouter>* router0, | 113 void CreateRouterPair(scoped_refptr<MultiplexRouter>* router0, |
114 scoped_refptr<MultiplexRouter>* router1) { | 114 scoped_refptr<MultiplexRouter>* router1) { |
115 MessagePipe pipe; | 115 MessagePipe pipe; |
116 *router0 = new MultiplexRouter(true, std::move(pipe.handle0), | 116 *router0 = new MultiplexRouter(std::move(pipe.handle0), |
| 117 MultiplexRouter::MULTI_INTERFACE, true, |
117 base::ThreadTaskRunnerHandle::Get()); | 118 base::ThreadTaskRunnerHandle::Get()); |
118 *router1 = new MultiplexRouter(false, std::move(pipe.handle1), | 119 *router1 = new MultiplexRouter(std::move(pipe.handle1), |
| 120 MultiplexRouter::MULTI_INTERFACE, false, |
119 base::ThreadTaskRunnerHandle::Get()); | 121 base::ThreadTaskRunnerHandle::Get()); |
120 } | 122 } |
121 | 123 |
122 void CreateIntegerSenderWithExistingRouters( | 124 void CreateIntegerSenderWithExistingRouters( |
123 scoped_refptr<MultiplexRouter> router0, | 125 scoped_refptr<MultiplexRouter> router0, |
124 IntegerSenderAssociatedPtrInfo* ptr_info0, | 126 IntegerSenderAssociatedPtrInfo* ptr_info0, |
125 scoped_refptr<MultiplexRouter> router1, | 127 scoped_refptr<MultiplexRouter> router1, |
126 IntegerSenderAssociatedRequest* request1) { | 128 IntegerSenderAssociatedRequest* request1) { |
127 router1->CreateAssociatedGroup()->CreateAssociatedInterface( | 129 router1->CreateAssociatedGroup()->CreateAssociatedInterface( |
128 AssociatedGroup::WILL_PASS_PTR, ptr_info0, request1); | 130 AssociatedGroup::WILL_PASS_PTR, ptr_info0, request1); |
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 run_loop.QuitClosure())); | 989 run_loop.QuitClosure())); |
988 | 990 |
989 request.ResetWithReason(789u, "long time no see"); | 991 request.ResetWithReason(789u, "long time no see"); |
990 | 992 |
991 run_loop.Run(); | 993 run_loop.Run(); |
992 } | 994 } |
993 | 995 |
994 } // namespace | 996 } // namespace |
995 } // namespace test | 997 } // namespace test |
996 } // namespace mojo | 998 } // namespace mojo |
OLD | NEW |