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

Unified Diff: mojo/system/local_data_pipe.cc

Issue 416203002: Convert BeginReadData...() to use the new user pointer handling (see r285350). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 5 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/system/local_data_pipe.h ('k') | mojo/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/system/local_data_pipe.cc
diff --git a/mojo/system/local_data_pipe.cc b/mojo/system/local_data_pipe.cc
index 8d37bcf06631754de127f05edfb86bdc937c7fa0..9194e3b5f5cb1af828413ef79fdd212d3c7823f2 100644
--- a/mojo/system/local_data_pipe.cc
+++ b/mojo/system/local_data_pipe.cc
@@ -240,11 +240,11 @@ MojoResult LocalDataPipe::ConsumerQueryDataImplNoLock(uint32_t* num_bytes) {
}
MojoResult LocalDataPipe::ConsumerBeginReadDataImplNoLock(
- const void** buffer,
- uint32_t* buffer_num_bytes,
- bool all_or_none) {
+ UserPointer<const void*> buffer,
+ UserPointer<uint32_t> buffer_num_bytes,
+ uint32_t min_num_bytes_to_read) {
size_t max_num_bytes_to_read = GetMaxNumBytesToReadNoLock();
- if (all_or_none && *buffer_num_bytes > max_num_bytes_to_read) {
+ 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_no_lock() ? MOJO_RESULT_OUT_OF_RANGE :
@@ -257,8 +257,8 @@ MojoResult LocalDataPipe::ConsumerBeginReadDataImplNoLock(
MOJO_RESULT_FAILED_PRECONDITION;
}
- *buffer = buffer_.get() + start_index_;
- *buffer_num_bytes = static_cast<uint32_t>(max_num_bytes_to_read);
+ buffer.Put(buffer_.get() + start_index_);
+ buffer_num_bytes.Put(static_cast<uint32_t>(max_num_bytes_to_read));
set_consumer_two_phase_max_num_bytes_read_no_lock(
static_cast<uint32_t>(max_num_bytes_to_read));
return MOJO_RESULT_OK;
« no previous file with comments | « mojo/system/local_data_pipe.h ('k') | mojo/system/local_data_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698