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

Unified Diff: mojo/edk/system/data_pipe_producer_dispatcher.cc

Issue 1374463002: Remove support for "all or none" two-phase data pipe read/write. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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/edk/system/data_pipe_producer_dispatcher.cc
diff --git a/mojo/edk/system/data_pipe_producer_dispatcher.cc b/mojo/edk/system/data_pipe_producer_dispatcher.cc
index ddb8b9f90f247d3be5f3e23f099c65174401e515..536dace9c295c2f286159c77dc66e81f52fb3e85 100644
--- a/mojo/edk/system/data_pipe_producer_dispatcher.cc
+++ b/mojo/edk/system/data_pipe_producer_dispatcher.cc
@@ -84,8 +84,12 @@ MojoResult DataPipeProducerDispatcher::BeginWriteDataImplNoLock(
MojoWriteDataFlags flags) {
mutex().AssertHeld();
- return data_pipe_->ProducerBeginWriteData(
- buffer, buffer_num_bytes, (flags & MOJO_WRITE_DATA_FLAG_ALL_OR_NONE));
+ // This flag may not be used in two-phase mode.
+ if ((flags & MOJO_WRITE_DATA_FLAG_ALL_OR_NONE))
+ return MOJO_RESULT_INVALID_ARGUMENT;
+
+ // TODO(vtl): Remove all-or-none support at lower levels.
+ return data_pipe_->ProducerBeginWriteData(buffer, buffer_num_bytes, false);
}
MojoResult DataPipeProducerDispatcher::EndWriteDataImplNoLock(

Powered by Google App Engine
This is Rietveld 408576698