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

Unified Diff: mojo/edk/system/data_pipe.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/data_pipe.h ('k') | mojo/edk/system/data_pipe_consumer_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/data_pipe.cc
diff --git a/mojo/edk/system/data_pipe.cc b/mojo/edk/system/data_pipe.cc
index a18c72de7b6f2450e561afdcb0f4cb5753bee3c6..bc2daea91b2f88ae8eb95574e9be75703f9cc451 100644
--- a/mojo/edk/system/data_pipe.cc
+++ b/mojo/edk/system/data_pipe.cc
@@ -309,8 +309,7 @@ MojoResult DataPipe::ProducerWriteData(UserPointer<const void> elements,
MojoResult DataPipe::ProducerBeginWriteData(
UserPointer<void*> buffer,
- UserPointer<uint32_t> buffer_num_bytes,
- bool all_or_none) {
+ UserPointer<uint32_t> buffer_num_bytes) {
MutexLocker locker(&mutex_);
DCHECK(has_local_producer_no_lock());
@@ -319,15 +318,7 @@ MojoResult DataPipe::ProducerBeginWriteData(
if (!consumer_open_no_lock())
return MOJO_RESULT_FAILED_PRECONDITION;
- uint32_t min_num_bytes_to_write = 0;
- if (all_or_none) {
- min_num_bytes_to_write = buffer_num_bytes.Get();
- if (min_num_bytes_to_write % element_num_bytes() != 0)
- return MOJO_RESULT_INVALID_ARGUMENT;
- }
-
- MojoResult rv = impl_->ProducerBeginWriteData(buffer, buffer_num_bytes,
- min_num_bytes_to_write);
+ MojoResult rv = impl_->ProducerBeginWriteData(buffer, buffer_num_bytes);
if (rv != MOJO_RESULT_OK)
return rv;
// Note: No need to awake producer awakables, even though we're going from
@@ -533,23 +524,14 @@ MojoResult DataPipe::ConsumerQueryData(UserPointer<uint32_t> num_bytes) {
MojoResult DataPipe::ConsumerBeginReadData(
UserPointer<const void*> buffer,
- UserPointer<uint32_t> buffer_num_bytes,
- bool all_or_none) {
+ UserPointer<uint32_t> buffer_num_bytes) {
MutexLocker locker(&mutex_);
DCHECK(has_local_consumer_no_lock());
if (consumer_in_two_phase_read_no_lock())
return MOJO_RESULT_BUSY;
- uint32_t min_num_bytes_to_read = 0;
- if (all_or_none) {
- min_num_bytes_to_read = buffer_num_bytes.Get();
- if (min_num_bytes_to_read % element_num_bytes() != 0)
- return MOJO_RESULT_INVALID_ARGUMENT;
- }
-
- MojoResult rv = impl_->ConsumerBeginReadData(buffer, buffer_num_bytes,
- min_num_bytes_to_read);
+ MojoResult rv = impl_->ConsumerBeginReadData(buffer, buffer_num_bytes);
if (rv != MOJO_RESULT_OK)
return rv;
DCHECK(consumer_in_two_phase_read_no_lock());
« no previous file with comments | « mojo/edk/system/data_pipe.h ('k') | mojo/edk/system/data_pipe_consumer_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698