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

Side by Side Diff: mojo/edk/system/data_pipe.h

Issue 2045003002: Make the data pipe "cancel all state" functions cancel two-phase operations. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | mojo/edk/system/data_pipe.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 #ifndef MOJO_EDK_SYSTEM_DATA_PIPE_H_ 5 #ifndef MOJO_EDK_SYSTEM_DATA_PIPE_H_
6 #define MOJO_EDK_SYSTEM_DATA_PIPE_H_ 6 #define MOJO_EDK_SYSTEM_DATA_PIPE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 // The following are only to be used by |DataPipeImpl| (and its subclasses): 168 // The following are only to be used by |DataPipeImpl| (and its subclasses):
169 169
170 // Replaces |impl_| with |new_impl| (which must not be null). For use when 170 // Replaces |impl_| with |new_impl| (which must not be null). For use when
171 // serializing data pipe dispatchers (i.e., in |ProducerEndSerialize()| and 171 // serializing data pipe dispatchers (i.e., in |ProducerEndSerialize()| and
172 // |ConsumerEndSerialize()|). Returns the old value of |impl_| (in case the 172 // |ConsumerEndSerialize()|). Returns the old value of |impl_| (in case the
173 // caller needs to manage its lifetime). 173 // caller needs to manage its lifetime).
174 std::unique_ptr<DataPipeImpl> ReplaceImplNoLock( 174 std::unique_ptr<DataPipeImpl> ReplaceImplNoLock(
175 std::unique_ptr<DataPipeImpl> new_impl) 175 std::unique_ptr<DataPipeImpl> new_impl)
176 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 176 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
177
178 void ProducerCancelAllStateNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
179 void ConsumerCancelAllStateNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
180
177 void SetProducerClosedNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 181 void SetProducerClosedNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
178 void SetConsumerClosedNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 182 void SetConsumerClosedNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
179 183
180 void ProducerCloseNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 184 void ProducerCloseNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
181 void ConsumerCloseNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 185 void ConsumerCloseNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
182 186
183 // Thread-safe and fast (they don't take |mutex_|): 187 // Thread-safe and fast (they don't take |mutex_|):
184 MojoCreateDataPipeOptions validated_options() const { 188 MojoCreateDataPipeOptions validated_options() const {
185 MojoCreateDataPipeOptions rv = {sizeof(MojoCreateDataPipeOptions), 189 MojoCreateDataPipeOptions rv = {sizeof(MojoCreateDataPipeOptions),
186 MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE, 190 MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 uint32_t consumer_two_phase_max_num_bytes_read_ MOJO_GUARDED_BY(mutex_); 307 uint32_t consumer_two_phase_max_num_bytes_read_ MOJO_GUARDED_BY(mutex_);
304 std::unique_ptr<DataPipeImpl> impl_ MOJO_GUARDED_BY(mutex_); 308 std::unique_ptr<DataPipeImpl> impl_ MOJO_GUARDED_BY(mutex_);
305 309
306 MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipe); 310 MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipe);
307 }; 311 };
308 312
309 } // namespace system 313 } // namespace system
310 } // namespace mojo 314 } // namespace mojo
311 315
312 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_H_ 316 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/system/data_pipe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698