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

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

Issue 2589663003: mojo:: Rename mojo::GetProxy() to mojo::MakeRequest() (Closed)
Patch Set: Rebase Created 4 years 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/tests/wtf_types_unittest.cc ('k') | net/dns/host_resolver_mojo.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_THREAD_SAFE_INTERFACE_PTR_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_THREAD_SAFE_INTERFACE_PTR_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_THREAD_SAFE_INTERFACE_PTR_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_THREAD_SAFE_INTERFACE_PTR_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 14 matching lines...) Expand all
25 // performed the interface call. 25 // performed the interface call.
26 // 26 //
27 // To create a ThreadSafeInterfacePtr/ThreadSafeAssociatedInterfacePtr, first 27 // To create a ThreadSafeInterfacePtr/ThreadSafeAssociatedInterfacePtr, first
28 // create a regular InterfacePtr/AssociatedInterfacePtr that 28 // create a regular InterfacePtr/AssociatedInterfacePtr that
29 // you then provide to ThreadSafeInterfacePtr/AssociatedInterfacePtr::Create. 29 // you then provide to ThreadSafeInterfacePtr/AssociatedInterfacePtr::Create.
30 // You can then call methods on the 30 // You can then call methods on the
31 // ThreadSafeInterfacePtr/AssociatedInterfacePtr instance from any thread. 31 // ThreadSafeInterfacePtr/AssociatedInterfacePtr instance from any thread.
32 // 32 //
33 // Ex for ThreadSafeInterfacePtr: 33 // Ex for ThreadSafeInterfacePtr:
34 // frob::FrobinatorPtr frobinator; 34 // frob::FrobinatorPtr frobinator;
35 // frob::FrobinatorImpl impl(GetProxy(&frobinator)); 35 // frob::FrobinatorImpl impl(MakeRequest(&frobinator));
36 // scoped_refptr<frob::ThreadSafeFrobinatorPtr> thread_safe_frobinator = 36 // scoped_refptr<frob::ThreadSafeFrobinatorPtr> thread_safe_frobinator =
37 // frob::ThreadSafeFrobinatorPtr::Create(std::move(frobinator)); 37 // frob::ThreadSafeFrobinatorPtr::Create(std::move(frobinator));
38 // (*thread_safe_frobinator)->FrobinateToTheMax(); 38 // (*thread_safe_frobinator)->FrobinateToTheMax();
39 // 39 //
40 // An alternate way is to create the ThreadSafeInterfacePtr unbound (not 40 // An alternate way is to create the ThreadSafeInterfacePtr unbound (not
41 // associated with an InterfacePtr) and call Bind() at a later time when the 41 // associated with an InterfacePtr) and call Bind() at a later time when the
42 // InterfacePtr becomes available. Note that you shouldn't call any interface 42 // InterfacePtr becomes available. Note that you shouldn't call any interface
43 // methods on the ThreadSafeInterfacePtr before it is bound. 43 // methods on the ThreadSafeInterfacePtr before it is bound.
44 44
45 template <typename Interface, template <typename> class InterfacePtrType> 45 template <typename Interface, template <typename> class InterfacePtrType>
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 using ThreadSafeAssociatedInterfacePtr = 182 using ThreadSafeAssociatedInterfacePtr =
183 ThreadSafeInterfacePtrBase<Interface, AssociatedInterfacePtr>; 183 ThreadSafeInterfacePtrBase<Interface, AssociatedInterfacePtr>;
184 184
185 template <typename Interface> 185 template <typename Interface>
186 using ThreadSafeInterfacePtr = 186 using ThreadSafeInterfacePtr =
187 ThreadSafeInterfacePtrBase<Interface, InterfacePtr>; 187 ThreadSafeInterfacePtrBase<Interface, InterfacePtr>;
188 188
189 } // namespace mojo 189 } // namespace mojo
190 190
191 #endif // MOJO_PUBLIC_CPP_BINDINGS_THREAD_SAFE_INTERFACE_PTR_H_ 191 #endif // MOJO_PUBLIC_CPP_BINDINGS_THREAD_SAFE_INTERFACE_PTR_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/wtf_types_unittest.cc ('k') | net/dns/host_resolver_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698