| OLD | NEW |
| 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 THIRD_PARTY_MOJO_SRC_MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ |
| 6 #define THIRD_PARTY_MOJO_SRC_MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ |
| 7 | 7 |
| 8 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h" | 8 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| 11 | 11 |
| 12 // Represents a request from a remote client for an implementation of Interface | 12 // Represents a request from a remote client for an implementation of Interface |
| 13 // over a specified message pipe. The implementor of the interface should | 13 // over a specified message pipe. The implementor of the interface should |
| 14 // remove the message pipe by calling PassMessagePipe() and bind it to the | 14 // remove the message pipe by calling PassMessagePipe() and bind it to the |
| 15 // implementation. If this is not done, the InterfaceRequest will automatically | 15 // implementation. If this is not done, the InterfaceRequest will automatically |
| 16 // close the pipe on destruction. Can also represent the absence of a request | 16 // close the pipe on destruction. Can also represent the absence of a request |
| 17 // if the client did not provide a message pipe. | 17 // if the client did not provide a message pipe. |
| 18 template <typename Interface> | 18 template <typename Interface> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // | 108 // |
| 109 template <typename Interface> | 109 template <typename Interface> |
| 110 InterfaceRequest<Interface> GetProxy(InterfacePtr<Interface>* ptr) { | 110 InterfaceRequest<Interface> GetProxy(InterfacePtr<Interface>* ptr) { |
| 111 MessagePipe pipe; | 111 MessagePipe pipe; |
| 112 ptr->Bind(InterfacePtrInfo<Interface>(pipe.handle0.Pass(), 0u)); | 112 ptr->Bind(InterfacePtrInfo<Interface>(pipe.handle0.Pass(), 0u)); |
| 113 return MakeRequest<Interface>(pipe.handle1.Pass()); | 113 return MakeRequest<Interface>(pipe.handle1.Pass()); |
| 114 } | 114 } |
| 115 | 115 |
| 116 } // namespace mojo | 116 } // namespace mojo |
| 117 | 117 |
| 118 #endif // THIRD_PARTY_MOJO_SRC_MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ | 118 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ |
| OLD | NEW |