| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 void ProducerRemoveAwakable(Awakable* awakable, | 121 void ProducerRemoveAwakable(Awakable* awakable, |
| 122 HandleSignalsState* signals_state); | 122 HandleSignalsState* signals_state); |
| 123 void ProducerStartSerialize(Channel* channel, | 123 void ProducerStartSerialize(Channel* channel, |
| 124 size_t* max_size, | 124 size_t* max_size, |
| 125 size_t* max_platform_handles); | 125 size_t* max_platform_handles); |
| 126 bool ProducerEndSerialize( | 126 bool ProducerEndSerialize( |
| 127 Channel* channel, | 127 Channel* channel, |
| 128 void* destination, | 128 void* destination, |
| 129 size_t* actual_size, | 129 size_t* actual_size, |
| 130 std::vector<platform::ScopedPlatformHandle>* platform_handles); | 130 std::vector<platform::ScopedPlatformHandle>* platform_handles); |
| 131 bool ProducerIsBusy() const; | |
| 132 | 131 |
| 133 // These are called by the consumer dispatcher to implement its methods of | 132 // These are called by the consumer dispatcher to implement its methods of |
| 134 // corresponding names. | 133 // corresponding names. |
| 135 void ConsumerCancelAllState(); | 134 void ConsumerCancelAllState(); |
| 136 void ConsumerClose(); | 135 void ConsumerClose(); |
| 137 MojoResult ConsumerSetOptions(uint32_t read_threshold_num_bytes); | 136 MojoResult ConsumerSetOptions(uint32_t read_threshold_num_bytes); |
| 138 void ConsumerGetOptions(uint32_t* read_threshold_num_bytes); | 137 void ConsumerGetOptions(uint32_t* read_threshold_num_bytes); |
| 139 // This does not validate its arguments, except to check that |*num_bytes| is | 138 // This does not validate its arguments, except to check that |*num_bytes| is |
| 140 // a multiple of |element_num_bytes_|. | 139 // a multiple of |element_num_bytes_|. |
| 141 MojoResult ConsumerReadData(UserPointer<void> elements, | 140 MojoResult ConsumerReadData(UserPointer<void> elements, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 156 void ConsumerRemoveAwakable(Awakable* awakable, | 155 void ConsumerRemoveAwakable(Awakable* awakable, |
| 157 HandleSignalsState* signals_state); | 156 HandleSignalsState* signals_state); |
| 158 void ConsumerStartSerialize(Channel* channel, | 157 void ConsumerStartSerialize(Channel* channel, |
| 159 size_t* max_size, | 158 size_t* max_size, |
| 160 size_t* max_platform_handles); | 159 size_t* max_platform_handles); |
| 161 bool ConsumerEndSerialize( | 160 bool ConsumerEndSerialize( |
| 162 Channel* channel, | 161 Channel* channel, |
| 163 void* destination, | 162 void* destination, |
| 164 size_t* actual_size, | 163 size_t* actual_size, |
| 165 std::vector<platform::ScopedPlatformHandle>* platform_handles); | 164 std::vector<platform::ScopedPlatformHandle>* platform_handles); |
| 166 bool ConsumerIsBusy() const; | |
| 167 | 165 |
| 168 // The following are only to be used by |DataPipeImpl| (and its subclasses): | 166 // The following are only to be used by |DataPipeImpl| (and its subclasses): |
| 169 | 167 |
| 170 // Replaces |impl_| with |new_impl| (which must not be null). For use when | 168 // Replaces |impl_| with |new_impl| (which must not be null). For use when |
| 171 // serializing data pipe dispatchers (i.e., in |ProducerEndSerialize()| and | 169 // serializing data pipe dispatchers (i.e., in |ProducerEndSerialize()| and |
| 172 // |ConsumerEndSerialize()|). Returns the old value of |impl_| (in case the | 170 // |ConsumerEndSerialize()|). Returns the old value of |impl_| (in case the |
| 173 // caller needs to manage its lifetime). | 171 // caller needs to manage its lifetime). |
| 174 std::unique_ptr<DataPipeImpl> ReplaceImplNoLock( | 172 std::unique_ptr<DataPipeImpl> ReplaceImplNoLock( |
| 175 std::unique_ptr<DataPipeImpl> new_impl) | 173 std::unique_ptr<DataPipeImpl> new_impl) |
| 176 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); | 174 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 uint32_t consumer_two_phase_max_num_bytes_read_ MOJO_GUARDED_BY(mutex_); | 305 uint32_t consumer_two_phase_max_num_bytes_read_ MOJO_GUARDED_BY(mutex_); |
| 308 std::unique_ptr<DataPipeImpl> impl_ MOJO_GUARDED_BY(mutex_); | 306 std::unique_ptr<DataPipeImpl> impl_ MOJO_GUARDED_BY(mutex_); |
| 309 | 307 |
| 310 MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipe); | 308 MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipe); |
| 311 }; | 309 }; |
| 312 | 310 |
| 313 } // namespace system | 311 } // namespace system |
| 314 } // namespace mojo | 312 } // namespace mojo |
| 315 | 313 |
| 316 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_H_ | 314 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_H_ |
| OLD | NEW |