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

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

Issue 629523003: Rename Get to GetProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix device Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_INTERFACE_REQUEST_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_
7 7
8 #include "mojo/public/cpp/bindings/interface_ptr.h" 8 #include "mojo/public/cpp/bindings/interface_ptr.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // Given the following interface: 53 // Given the following interface:
54 // 54 //
55 // interface Foo { 55 // interface Foo {
56 // CreateBar(Bar& bar); 56 // CreateBar(Bar& bar);
57 // } 57 // }
58 // 58 //
59 // The caller of CreateBar would have code similar to the following: 59 // The caller of CreateBar would have code similar to the following:
60 // 60 //
61 // InterfacePtr<Foo> foo = ...; 61 // InterfacePtr<Foo> foo = ...;
62 // InterfacePtr<Bar> bar; 62 // InterfacePtr<Bar> bar;
63 // foo->CreateBar(Get(&bar)); 63 // foo->CreateBar(GetProxy(&bar));
64 // 64 //
65 // Upon return from CreateBar, |bar| is ready to have methods called on it. 65 // Upon return from CreateBar, |bar| is ready to have methods called on it.
66 // 66 //
67 template <typename Interface> 67 template <typename Interface>
68 InterfaceRequest<Interface> Get(InterfacePtr<Interface>* ptr) { 68 InterfaceRequest<Interface> GetProxy(InterfacePtr<Interface>* ptr) {
69 MessagePipe pipe; 69 MessagePipe pipe;
70 ptr->Bind(pipe.handle0.Pass()); 70 ptr->Bind(pipe.handle0.Pass());
71 return MakeRequest<Interface>(pipe.handle1.Pass()); 71 return MakeRequest<Interface>(pipe.handle1.Pass());
72 } 72 }
73 73
74 } // namespace mojo 74 } // namespace mojo
75 75
76 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ 76 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/application/lib/application_impl.cc ('k') | mojo/public/cpp/bindings/tests/handle_passing_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698