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

Unified Diff: mojo/public/c/system/message_pipe.h

Issue 1785843002: [mojo] Implement pipe fusion API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
« no previous file with comments | « mojo/edk/system/ports/node.cc ('k') | mojo/public/cpp/bindings/interface_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/system/message_pipe.h
diff --git a/mojo/public/c/system/message_pipe.h b/mojo/public/c/system/message_pipe.h
index 10da5256740546f076dd42d29b871b4a2924e1d7..8c5c215eafa4c8a19a02045021d8e5fa446ecda0 100644
--- a/mojo/public/c/system/message_pipe.h
+++ b/mojo/public/c/system/message_pipe.h
@@ -181,6 +181,31 @@ MOJO_SYSTEM_EXPORT MojoResult
uint32_t* num_handles, // Optional in/out.
MojoReadMessageFlags flags);
+// Fuses two message pipe endpoints together. Given two pipes:
+//
+// A <-> B and C <-> D
+//
+// Fusing handle B and handle C results in a single pipe:
+//
+// A <-> D
+//
+// Handles B and C are ALWAYS closed. Any unread messages at C will eventually
+// be delivered to A, and any unread messages at B will eventually be delivered
+// to D.
+//
+// NOTE: A handle may only be fused if it is an open message pipe handle which
+// has not been written to.
+//
+// Returns:
+// |MOJO_RESULT_OK| on success.
+// |MOJO_RESULT_FAILED_PRECONDITION| if both handles were valid message pipe
+// handles but could not be merged (e.g. one of them has been written to).
+// |MOJO_INVALID_ARGUMENT| if either handle is not a fusable message pipe
+// handle.
+MOJO_SYSTEM_EXPORT MojoResult
+ MojoFuseMessagePipes(MojoHandle handle0, MojoHandle handle1);
+
+
#ifdef __cplusplus
} // extern "C"
#endif
« no previous file with comments | « mojo/edk/system/ports/node.cc ('k') | mojo/public/cpp/bindings/interface_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698