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> |
| 11 |
10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
12 #include "mojo/edk/embedder/platform_handle_vector.h" | 14 #include "mojo/edk/embedder/platform_handle_vector.h" |
13 #include "mojo/edk/system/channel_endpoint_client.h" | 15 #include "mojo/edk/system/channel_endpoint_client.h" |
14 #include "mojo/edk/system/handle_signals_state.h" | 16 #include "mojo/edk/system/handle_signals_state.h" |
15 #include "mojo/edk/system/memory.h" | 17 #include "mojo/edk/system/memory.h" |
16 #include "mojo/edk/system/mutex.h" | 18 #include "mojo/edk/system/mutex.h" |
17 #include "mojo/edk/system/system_impl_export.h" | 19 #include "mojo/edk/system/system_impl_export.h" |
18 #include "mojo/edk/system/thread_annotations.h" | 20 #include "mojo/edk/system/thread_annotations.h" |
19 #include "mojo/public/c/system/data_pipe.h" | 21 #include "mojo/public/c/system/data_pipe.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 265 } |
264 | 266 |
265 MSVC_SUPPRESS_WARNING(4324) | 267 MSVC_SUPPRESS_WARNING(4324) |
266 const MojoCreateDataPipeOptions validated_options_; | 268 const MojoCreateDataPipeOptions validated_options_; |
267 | 269 |
268 mutable Mutex mutex_; | 270 mutable Mutex mutex_; |
269 // *Known* state of producer or consumer. | 271 // *Known* state of producer or consumer. |
270 bool producer_open_ MOJO_GUARDED_BY(mutex_); | 272 bool producer_open_ MOJO_GUARDED_BY(mutex_); |
271 bool consumer_open_ MOJO_GUARDED_BY(mutex_); | 273 bool consumer_open_ MOJO_GUARDED_BY(mutex_); |
272 // Non-null only if the producer or consumer, respectively, is local. | 274 // Non-null only if the producer or consumer, respectively, is local. |
273 scoped_ptr<AwakableList> producer_awakable_list_ MOJO_GUARDED_BY(mutex_); | 275 std::unique_ptr<AwakableList> producer_awakable_list_ MOJO_GUARDED_BY(mutex_); |
274 scoped_ptr<AwakableList> consumer_awakable_list_ MOJO_GUARDED_BY(mutex_); | 276 std::unique_ptr<AwakableList> consumer_awakable_list_ MOJO_GUARDED_BY(mutex_); |
275 // These are nonzero if and only if a two-phase write/read is in progress. | 277 // These are nonzero if and only if a two-phase write/read is in progress. |
276 uint32_t producer_two_phase_max_num_bytes_written_ MOJO_GUARDED_BY(mutex_); | 278 uint32_t producer_two_phase_max_num_bytes_written_ MOJO_GUARDED_BY(mutex_); |
277 uint32_t consumer_two_phase_max_num_bytes_read_ MOJO_GUARDED_BY(mutex_); | 279 uint32_t consumer_two_phase_max_num_bytes_read_ MOJO_GUARDED_BY(mutex_); |
278 scoped_ptr<DataPipeImpl> impl_ MOJO_GUARDED_BY(mutex_); | 280 scoped_ptr<DataPipeImpl> impl_ MOJO_GUARDED_BY(mutex_); |
279 | 281 |
280 MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipe); | 282 MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipe); |
281 }; | 283 }; |
282 | 284 |
283 } // namespace system | 285 } // namespace system |
284 } // namespace mojo | 286 } // namespace mojo |
285 | 287 |
286 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_H_ | 288 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_H_ |
OLD | NEW |