Chromium Code Reviews| Index: mojo/public/cpp/bindings/interface_request.h |
| diff --git a/mojo/public/cpp/bindings/interface_request.h b/mojo/public/cpp/bindings/interface_request.h |
| index f67566d2d0ef76e2537eafe22b0e31f55f42a649..2e3193e00f30fc1b440cdad1197940547058fc95 100644 |
| --- a/mojo/public/cpp/bindings/interface_request.h |
| +++ b/mojo/public/cpp/bindings/interface_request.h |
| @@ -117,6 +117,16 @@ InterfaceRequest<Interface> GetProxy(InterfacePtr<Interface>* ptr) { |
| return MakeRequest<Interface>(std::move(pipe.handle1)); |
| } |
| +// Fuses an InterfaceRequest<T> endpoint with an InterfacePtr<T> endpoint. |
|
yzshen1
2016/03/11 17:17:20
Nit: InterfacePtrInfo
|
| +// Returns |true| on success or |false| on failure. |
| +template <typename Interface> |
| +bool FuseInterface(InterfaceRequest<Interface> request, |
| + InterfacePtrInfo<Interface> proxy_info) { |
| + MojoResult result = FuseMessagePipes(request.PassMessagePipe(), |
| + proxy_info.PassHandle()); |
| + return result == MOJO_RESULT_OK; |
| +} |
| + |
| } // namespace mojo |
| #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_REQUEST_H_ |