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

Unified Diff: mojo/public/cpp/bindings/interface_request.h

Issue 1785843002: [mojo] Implement pipe fusion API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698