Index: mojo/edk/system/local_data_pipe.cc |
diff --git a/mojo/edk/system/local_data_pipe.cc b/mojo/edk/system/local_data_pipe.cc |
index 8ee696cc8a1ac6f1fb5dc5e83350ba4211c2d151..fdfaf28cb2ab8f4809358c784077d8ca7a94775e 100644 |
--- a/mojo/edk/system/local_data_pipe.cc |
+++ b/mojo/edk/system/local_data_pipe.cc |
@@ -177,7 +177,8 @@ MojoResult LocalDataPipe::ConsumerReadDataImplNoLock( |
UserPointer<void> elements, |
UserPointer<uint32_t> num_bytes, |
uint32_t max_num_bytes_to_read, |
- uint32_t min_num_bytes_to_read) { |
+ uint32_t min_num_bytes_to_read, |
+ bool peek) { |
DCHECK_EQ(max_num_bytes_to_read % element_num_bytes(), 0u); |
DCHECK_EQ(min_num_bytes_to_read % element_num_bytes(), 0u); |
DCHECK_GT(max_num_bytes_to_read, 0u); |
@@ -207,7 +208,8 @@ MojoResult LocalDataPipe::ConsumerReadDataImplNoLock( |
.PutArray(buffer_.get(), num_bytes_to_read - num_bytes_to_read_first); |
} |
- MarkDataAsConsumedNoLock(num_bytes_to_read); |
+ if (!peek) |
+ MarkDataAsConsumedNoLock(num_bytes_to_read); |
num_bytes.Put(static_cast<uint32_t>(num_bytes_to_read)); |
return MOJO_RESULT_OK; |
} |