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

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

Issue 703273002: Update mojo sdk to rev 04a510fb37db10642e156957f9b2c11c2f6442ac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix content/child -> mojo/common linking Created 6 years, 1 month 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.h ('k') | mojo/edk/system/local_data_pipe_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « mojo/edk/system/local_data_pipe.h ('k') | mojo/edk/system/local_data_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698