| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |