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

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

Issue 1365383004: Cleanup: Remove internal two-phase data pipe all-or-none support. (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
« no previous file with comments | « mojo/edk/system/local_data_pipe_impl.h ('k') | mojo/edk/system/remote_consumer_data_pipe_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/local_data_pipe_impl.cc
diff --git a/mojo/edk/system/local_data_pipe_impl.cc b/mojo/edk/system/local_data_pipe_impl.cc
index 3d2e9e5f09d1fccd78cf2814eaeb48400b407322..8f878d56a4aef413e50328beb25acbc8ac21794e 100644
--- a/mojo/edk/system/local_data_pipe_impl.cc
+++ b/mojo/edk/system/local_data_pipe_impl.cc
@@ -107,8 +107,7 @@ MojoResult LocalDataPipeImpl::ProducerWriteData(
MojoResult LocalDataPipeImpl::ProducerBeginWriteData(
UserPointer<void*> buffer,
- UserPointer<uint32_t> buffer_num_bytes,
- uint32_t min_num_bytes_to_write) {
+ UserPointer<uint32_t> buffer_num_bytes) {
DCHECK(consumer_open());
// The index we need to start writing at.
@@ -116,12 +115,6 @@ MojoResult LocalDataPipeImpl::ProducerBeginWriteData(
(start_index_ + current_num_bytes_) % capacity_num_bytes();
size_t max_num_bytes_to_write = GetMaxNumBytesToWrite();
- if (min_num_bytes_to_write > max_num_bytes_to_write) {
- // Don't return "should wait" since you can't wait for a specified amount
- // of data.
- return MOJO_RESULT_OUT_OF_RANGE;
- }
-
// Don't go into a two-phase write if there's no room.
if (max_num_bytes_to_write == 0)
return MOJO_RESULT_SHOULD_WAIT;
@@ -289,16 +282,8 @@ MojoResult LocalDataPipeImpl::ConsumerQueryData(
MojoResult LocalDataPipeImpl::ConsumerBeginReadData(
UserPointer<const void*> buffer,
- UserPointer<uint32_t> buffer_num_bytes,
- uint32_t min_num_bytes_to_read) {
+ UserPointer<uint32_t> buffer_num_bytes) {
size_t max_num_bytes_to_read = GetMaxNumBytesToRead();
- if (min_num_bytes_to_read > max_num_bytes_to_read) {
- // Don't return "should wait" since you can't wait for a specified amount of
- // data.
- return producer_open() ? MOJO_RESULT_OUT_OF_RANGE
- : MOJO_RESULT_FAILED_PRECONDITION;
- }
-
// Don't go into a two-phase read if there's no data.
if (max_num_bytes_to_read == 0) {
return producer_open() ? MOJO_RESULT_SHOULD_WAIT
« no previous file with comments | « mojo/edk/system/local_data_pipe_impl.h ('k') | mojo/edk/system/remote_consumer_data_pipe_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698