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

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

Issue 1412733002: C++ bindings: separate out serialization source set, have "mojom" targets optionally use serializat… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: address comments from previous patch Created 5 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
« no previous file with comments | « mojo/public/cpp/bindings/BUILD.gn ('k') | mojo/public/cpp/bindings/lib/array_serialization.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/bindings/interface_ptr.h" 8 #include "mojo/public/cpp/system/message_pipe.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 11
12 template <typename I>
13 class InterfacePtr;
14
15 template <typename I>
16 class InterfacePtrInfo;
17
12 // Represents a request from a remote client for an implementation of Interface 18 // Represents a request from a remote client for an implementation of Interface
13 // over a specified message pipe. The implementor of the interface should 19 // over a specified message pipe. The implementor of the interface should
14 // remove the message pipe by calling PassMessagePipe() and bind it to the 20 // remove the message pipe by calling PassMessagePipe() and bind it to the
15 // implementation. If this is not done, the InterfaceRequest will automatically 21 // implementation. If this is not done, the InterfaceRequest will automatically
16 // close the pipe on destruction. Can also represent the absence of a request 22 // close the pipe on destruction. Can also represent the absence of a request
17 // if the client did not provide a message pipe. 23 // if the client did not provide a message pipe.
18 template <typename Interface> 24 template <typename Interface>
19 class InterfaceRequest { 25 class InterfaceRequest {
20 public: 26 public:
21 // Constructs an empty InterfaceRequest, representing that the client is not 27 // Constructs an empty InterfaceRequest, representing that the client is not
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 template <typename Interface> 116 template <typename Interface>
111 InterfaceRequest<Interface> GetProxy(InterfacePtr<Interface>* ptr) { 117 InterfaceRequest<Interface> GetProxy(InterfacePtr<Interface>* ptr) {
112 MessagePipe pipe; 118 MessagePipe pipe;
113 ptr->Bind(InterfacePtrInfo<Interface>(pipe.handle0.Pass(), 0u)); 119 ptr->Bind(InterfacePtrInfo<Interface>(pipe.handle0.Pass(), 0u));
114 return MakeRequest<Interface>(pipe.handle1.Pass()); 120 return MakeRequest<Interface>(pipe.handle1.Pass());
115 } 121 }
116 122
117 } // namespace mojo 123 } // namespace mojo
118 124
119 #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/BUILD.gn ('k') | mojo/public/cpp/bindings/lib/array_serialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698