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

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

Issue 2042363003: Allow data pipe producer/consumer handles to be transferred during two-phase operations. (Closed) Base URL: https://github.com/domokit/mojo.git@work790_dp_cancel_two_phase
Patch Set: Created 4 years, 6 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/handle_table.cc ('k') | mojo/public/c/system/handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/system/data_pipe.h
diff --git a/mojo/public/c/system/data_pipe.h b/mojo/public/c/system/data_pipe.h
index 994a12b09c4735513f754a3e5f85f6ea58a71a56..64416957a68643fea5406e33f1054a6c1c84f1f8 100644
--- a/mojo/public/c/system/data_pipe.h
+++ b/mojo/public/c/system/data_pipe.h
@@ -266,6 +266,15 @@ MojoResult MojoWriteData(MojoHandle data_pipe_producer_handle, // In.
// specify the amount written and to complete the two-phase write.
// |MojoEndWriteData()| need not be called for other return values.
//
+// Note: After a successful |MojoBeginWriteData()| on a given handle and before
+// a corresponding |MojoEndWriteData()|, any operation that invalidates the
+// handle (such as closing the handle, replacing the handle with one with
+// reduced rights, or transferring the handle over a message pipe) will abort
+// the two-phase write. That is, the behavior is equivalent to ending the
+// two-phase write with no data written. That operation will also invalidate the
+// buffer pointer: the behavior if data continues to be written to the buffer is
+// undefined.
+//
// Returns:
// |MOJO_RESULT_OK| on success.
// |MOJO_RESULT_INVALID_ARGUMENT| if some argument was invalid (e.g.,
@@ -440,6 +449,15 @@ MojoResult MojoReadData(MojoHandle data_pipe_consumer_handle, // In.
// |MojoEndReadData()| to specify the amount read and to complete the two-phase
// read.
//
+// Note: After a successful |MojoBeginReadData()| on a given handle and before a
+// corresponding |MojoEndReadData()|, any operation that invalidates the handle
+// (such as closing the handle, replacing the handle with one with reduced
+// rights, or transferring the handle over a message pipe) will abort the
+// two-phase read. That is, the behavior is equivalent to ending the two-phase
+// read with no data consumed. That operation will also invalidate the buffer
+// pointer: the behavior if data continues to be read from the buffer is
+// undefined.
+//
// Returns:
// |MOJO_RESULT_OK| on success.
// |MOJO_RESULT_INVALID_ARGUMENT| if some argument was invalid (e.g.,
« no previous file with comments | « mojo/edk/system/handle_table.cc ('k') | mojo/public/c/system/handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698