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

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

Issue 2072353002: Give AwakableList's wake-up method the old state in addition to the new state. (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 | « mojo/edk/system/awakable_list_unittest.cc ('k') | 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 DataPipe(bool has_local_producer, 268 DataPipe(bool has_local_producer,
269 bool has_local_consumer, 269 bool has_local_consumer,
270 const MojoCreateDataPipeOptions& validated_options, 270 const MojoCreateDataPipeOptions& validated_options,
271 std::unique_ptr<DataPipeImpl> impl); 271 std::unique_ptr<DataPipeImpl> impl);
272 ~DataPipe() override; 272 ~DataPipe() override;
273 273
274 // |ChannelEndpointClient| implementation: 274 // |ChannelEndpointClient| implementation:
275 bool OnReadMessage(unsigned port, MessageInTransit* message) override; 275 bool OnReadMessage(unsigned port, MessageInTransit* message) override;
276 void OnDetachFromChannel(unsigned port) override; 276 void OnDetachFromChannel(unsigned port) override;
277 277
278 void AwakeProducerAwakablesForStateChangeNoLock( 278 void OnProducerMaybeStateChange(const HandleSignalsState& old_producer_state,
279 const HandleSignalsState& new_producer_state) 279 const HandleSignalsState& new_producer_state)
280 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 280 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
281 void AwakeConsumerAwakablesForStateChangeNoLock( 281 void OnConsumerMaybeStateChange(const HandleSignalsState& old_consumer_state,
282 const HandleSignalsState& new_consumer_state) 282 const HandleSignalsState& new_consumer_state)
283 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 283 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
284 284
285 void SetProducerClosed(); 285 void SetProducerClosed();
286 void SetConsumerClosed(); 286 void SetConsumerClosed();
287 287
288 bool has_local_producer_no_lock() const MOJO_SHARED_LOCKS_REQUIRED(mutex_) { 288 bool has_local_producer_no_lock() const MOJO_SHARED_LOCKS_REQUIRED(mutex_) {
289 mutex_.AssertHeld(); 289 mutex_.AssertHeld();
290 return !!producer_awakable_list_; 290 return !!producer_awakable_list_;
291 } 291 }
292 bool has_local_consumer_no_lock() const MOJO_SHARED_LOCKS_REQUIRED(mutex_) { 292 bool has_local_consumer_no_lock() const MOJO_SHARED_LOCKS_REQUIRED(mutex_) {
(...skipping 20 matching lines...) Expand all
313 uint32_t consumer_two_phase_max_num_bytes_read_ MOJO_GUARDED_BY(mutex_); 313 uint32_t consumer_two_phase_max_num_bytes_read_ MOJO_GUARDED_BY(mutex_);
314 std::unique_ptr<DataPipeImpl> impl_ MOJO_GUARDED_BY(mutex_); 314 std::unique_ptr<DataPipeImpl> impl_ MOJO_GUARDED_BY(mutex_);
315 315
316 MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipe); 316 MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipe);
317 }; 317 };
318 318
319 } // namespace system 319 } // namespace system
320 } // namespace mojo 320 } // namespace mojo
321 321
322 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_H_ 322 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/awakable_list_unittest.cc ('k') | mojo/edk/system/data_pipe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698