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

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

Issue 1408793006: Convert "return local_var.Pass();" to "return local_var;". (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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/interface_ptr.h ('k') | mojo/public/cpp/bindings/map.h » ('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 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/system/message_pipe.h" 8 #include "mojo/public/cpp/system/message_pipe.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 MOJO_MOVE_ONLY_TYPE(InterfaceRequest); 60 MOJO_MOVE_ONLY_TYPE(InterfaceRequest);
61 }; 61 };
62 62
63 // Makes an InterfaceRequest bound to the specified message pipe. If |handle| 63 // Makes an InterfaceRequest bound to the specified message pipe. If |handle|
64 // is empty or invalid, the resulting InterfaceRequest will represent the 64 // is empty or invalid, the resulting InterfaceRequest will represent the
65 // absence of a request. 65 // absence of a request.
66 template <typename Interface> 66 template <typename Interface>
67 InterfaceRequest<Interface> MakeRequest(ScopedMessagePipeHandle handle) { 67 InterfaceRequest<Interface> MakeRequest(ScopedMessagePipeHandle handle) {
68 InterfaceRequest<Interface> request; 68 InterfaceRequest<Interface> request;
69 request.Bind(handle.Pass()); 69 request.Bind(handle.Pass());
70 return request.Pass(); 70 return request;
71 } 71 }
72 72
73 // Creates a new message pipe over which Interface is to be served. Binds the 73 // Creates a new message pipe over which Interface is to be served. Binds the
74 // specified InterfacePtr to one end of the message pipe, and returns an 74 // specified InterfacePtr to one end of the message pipe, and returns an
75 // InterfaceRequest bound to the other. The InterfacePtr should be passed to 75 // InterfaceRequest bound to the other. The InterfacePtr should be passed to
76 // the client, and the InterfaceRequest should be passed to whatever will 76 // the client, and the InterfaceRequest should be passed to whatever will
77 // provide the implementation. The implementation should typically be bound to 77 // provide the implementation. The implementation should typically be bound to
78 // the InterfaceRequest using the Binding or StrongBinding classes. The client 78 // the InterfaceRequest using the Binding or StrongBinding classes. The client
79 // may begin to issue calls even before an implementation has been bound, since 79 // may begin to issue calls even before an implementation has been bound, since
80 // messages sent over the pipe will just queue up until they are consumed by 80 // messages sent over the pipe will just queue up until they are consumed by
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 template <typename Interface> 116 template <typename Interface>
117 InterfaceRequest<Interface> GetProxy(InterfacePtr<Interface>* ptr) { 117 InterfaceRequest<Interface> GetProxy(InterfacePtr<Interface>* ptr) {
118 MessagePipe pipe; 118 MessagePipe pipe;
119 ptr->Bind(InterfacePtrInfo<Interface>(pipe.handle0.Pass(), 0u)); 119 ptr->Bind(InterfacePtrInfo<Interface>(pipe.handle0.Pass(), 0u));
120 return MakeRequest<Interface>(pipe.handle1.Pass()); 120 return MakeRequest<Interface>(pipe.handle1.Pass());
121 } 121 }
122 122
123 } // namespace mojo 123 } // namespace mojo
124 124
125 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ 125 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/interface_ptr.h ('k') | mojo/public/cpp/bindings/map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698