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

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

Issue 2345013002: Mojo C++ bindings: remove the lock in MultiplexRouter if it only serves a single interface. (Closed)
Patch Set: . Created 4 years, 3 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 | « mojo/public/cpp/bindings/BUILD.gn ('k') | mojo/public/cpp/bindings/lib/binding_state.cc » ('j') | 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 ptr->Bind(std::move(ptr_info), std::move(runner)); 225 ptr->Bind(std::move(ptr_info), std::move(runner));
226 return request; 226 return request;
227 } 227 }
228 228
229 // Creates an associated interface proxy which casts its messages into the void. 229 // Creates an associated interface proxy which casts its messages into the void.
230 template <typename Interface> 230 template <typename Interface>
231 void GetDummyProxyForTesting(AssociatedInterfacePtr<Interface>* proxy) { 231 void GetDummyProxyForTesting(AssociatedInterfacePtr<Interface>* proxy) {
232 MessagePipe pipe; 232 MessagePipe pipe;
233 scoped_refptr<internal::MultiplexRouter> router = 233 scoped_refptr<internal::MultiplexRouter> router =
234 new internal::MultiplexRouter(false, std::move(pipe.handle0), 234 new internal::MultiplexRouter(std::move(pipe.handle0),
235 base::ThreadTaskRunnerHandle::Get()); 235 internal::MultiplexRouter::MULTI_INTERFACE,
236 false, base::ThreadTaskRunnerHandle::Get());
236 std::unique_ptr<AssociatedGroup> group = router->CreateAssociatedGroup(); 237 std::unique_ptr<AssociatedGroup> group = router->CreateAssociatedGroup();
237 GetProxy(proxy, group.get()); 238 GetProxy(proxy, group.get());
238 } 239 }
239 240
240 } // namespace mojo 241 } // namespace mojo
241 242
242 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ 243 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/BUILD.gn ('k') | mojo/public/cpp/bindings/lib/binding_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698