| 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 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 void GetDummyProxyForTesting(AssociatedInterfacePtr<Interface>* proxy) { | 260 void GetDummyProxyForTesting(AssociatedInterfacePtr<Interface>* proxy) { |
| 261 MessagePipe pipe; | 261 MessagePipe pipe; |
| 262 scoped_refptr<internal::MultiplexRouter> router = | 262 scoped_refptr<internal::MultiplexRouter> router = |
| 263 new internal::MultiplexRouter(std::move(pipe.handle0), | 263 new internal::MultiplexRouter(std::move(pipe.handle0), |
| 264 internal::MultiplexRouter::MULTI_INTERFACE, | 264 internal::MultiplexRouter::MULTI_INTERFACE, |
| 265 false, base::ThreadTaskRunnerHandle::Get()); | 265 false, base::ThreadTaskRunnerHandle::Get()); |
| 266 std::unique_ptr<AssociatedGroup> group = router->CreateAssociatedGroup(); | 266 std::unique_ptr<AssociatedGroup> group = router->CreateAssociatedGroup(); |
| 267 MakeRequest(proxy, group.get()); | 267 MakeRequest(proxy, group.get()); |
| 268 } | 268 } |
| 269 | 269 |
| 270 template <typename Interface> |
| 271 scoped_refptr<AssociatedGroupController> GetRemoteGroupControllerForTesting( |
| 272 AssociatedInterfacePtr<Interface>* proxy) { |
| 273 MessagePipe pipe; |
| 274 scoped_refptr<internal::MultiplexRouter> router0 = |
| 275 new internal::MultiplexRouter(std::move(pipe.handle0), |
| 276 internal::MultiplexRouter::MULTI_INTERFACE, |
| 277 true, base::ThreadTaskRunnerHandle::Get()); |
| 278 scoped_refptr<internal::MultiplexRouter> router1 = |
| 279 new internal::MultiplexRouter(std::move(pipe.handle1), |
| 280 internal::MultiplexRouter::MULTI_INTERFACE, |
| 281 false, base::ThreadTaskRunnerHandle::Get()); |
| 282 |
| 283 std::unique_ptr<AssociatedGroup> group = router0->CreateAssociatedGroup(); |
| 284 MakeRequest(proxy, group.get()); |
| 285 |
| 286 return router1; |
| 287 } |
| 288 |
| 270 } // namespace mojo | 289 } // namespace mojo |
| 271 | 290 |
| 272 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ | 291 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ |
| OLD | NEW |