Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(719)

Side by Side Diff: mojo/public/cpp/bindings/associated_interface_ptr.h

Issue 2606593002: [ServiceWorker] Associate interfaces.
Patch Set: Fix unit tests Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/test/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « content/test/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698