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

Side by Side Diff: mojo/edk/system/data_pipe_consumer_dispatcher.cc

Issue 728133002: Update mojo sdk to rev e01f9a49449381a5eb430c1fd88bf2cae73ec35a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android + ios gyp fixes 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 unified diff | Download patch
« no previous file with comments | « mojo/edk/system/data_pipe.cc ('k') | mojo/edk/system/data_pipe_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/edk/system/data_pipe_consumer_dispatcher.h" 5 #include "mojo/edk/system/data_pipe_consumer_dispatcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/edk/system/data_pipe.h" 8 #include "mojo/edk/system/data_pipe.h"
9 #include "mojo/edk/system/memory.h" 9 #include "mojo/edk/system/memory.h"
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if ((flags & MOJO_READ_DATA_FLAG_QUERY)) { 70 if ((flags & MOJO_READ_DATA_FLAG_QUERY)) {
71 if ((flags & MOJO_READ_DATA_FLAG_PEEK)) 71 if ((flags & MOJO_READ_DATA_FLAG_PEEK))
72 return MOJO_RESULT_INVALID_ARGUMENT; 72 return MOJO_RESULT_INVALID_ARGUMENT;
73 DCHECK(!(flags & MOJO_READ_DATA_FLAG_DISCARD)); // Handled above. 73 DCHECK(!(flags & MOJO_READ_DATA_FLAG_DISCARD)); // Handled above.
74 DVLOG_IF(2, !elements.IsNull()) 74 DVLOG_IF(2, !elements.IsNull())
75 << "Query mode: ignoring non-null |elements|"; 75 << "Query mode: ignoring non-null |elements|";
76 return data_pipe_->ConsumerQueryData(num_bytes); 76 return data_pipe_->ConsumerQueryData(num_bytes);
77 } 77 }
78 78
79 return data_pipe_->ConsumerReadData( 79 return data_pipe_->ConsumerReadData(
80 elements, 80 elements, num_bytes, !!(flags & MOJO_READ_DATA_FLAG_ALL_OR_NONE),
81 num_bytes,
82 !!(flags & MOJO_READ_DATA_FLAG_ALL_OR_NONE),
83 !!(flags & MOJO_READ_DATA_FLAG_PEEK)); 81 !!(flags & MOJO_READ_DATA_FLAG_PEEK));
84 } 82 }
85 83
86 MojoResult DataPipeConsumerDispatcher::BeginReadDataImplNoLock( 84 MojoResult DataPipeConsumerDispatcher::BeginReadDataImplNoLock(
87 UserPointer<const void*> buffer, 85 UserPointer<const void*> buffer,
88 UserPointer<uint32_t> buffer_num_bytes, 86 UserPointer<uint32_t> buffer_num_bytes,
89 MojoReadDataFlags flags) { 87 MojoReadDataFlags flags) {
90 lock().AssertAcquired(); 88 lock().AssertAcquired();
91 89
92 // These flags may not be used in two-phase mode. 90 // These flags may not be used in two-phase mode.
93 if ((flags & MOJO_READ_DATA_FLAG_DISCARD) || 91 if ((flags & MOJO_READ_DATA_FLAG_DISCARD) ||
94 (flags & MOJO_READ_DATA_FLAG_QUERY) || 92 (flags & MOJO_READ_DATA_FLAG_QUERY) || (flags & MOJO_READ_DATA_FLAG_PEEK))
95 (flags & MOJO_READ_DATA_FLAG_PEEK))
96 return MOJO_RESULT_INVALID_ARGUMENT; 93 return MOJO_RESULT_INVALID_ARGUMENT;
97 94
98 return data_pipe_->ConsumerBeginReadData( 95 return data_pipe_->ConsumerBeginReadData(
99 buffer, buffer_num_bytes, (flags & MOJO_READ_DATA_FLAG_ALL_OR_NONE)); 96 buffer, buffer_num_bytes, (flags & MOJO_READ_DATA_FLAG_ALL_OR_NONE));
100 } 97 }
101 98
102 MojoResult DataPipeConsumerDispatcher::EndReadDataImplNoLock( 99 MojoResult DataPipeConsumerDispatcher::EndReadDataImplNoLock(
103 uint32_t num_bytes_read) { 100 uint32_t num_bytes_read) {
104 lock().AssertAcquired(); 101 lock().AssertAcquired();
105 102
(...skipping 22 matching lines...) Expand all
128 data_pipe_->ConsumerRemoveWaiter(waiter, signals_state); 125 data_pipe_->ConsumerRemoveWaiter(waiter, signals_state);
129 } 126 }
130 127
131 bool DataPipeConsumerDispatcher::IsBusyNoLock() const { 128 bool DataPipeConsumerDispatcher::IsBusyNoLock() const {
132 lock().AssertAcquired(); 129 lock().AssertAcquired();
133 return data_pipe_->ConsumerIsBusy(); 130 return data_pipe_->ConsumerIsBusy();
134 } 131 }
135 132
136 } // namespace system 133 } // namespace system
137 } // namespace mojo 134 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/data_pipe.cc ('k') | mojo/edk/system/data_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698