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_SYSTEM_DATA_PIPE_H_ | 5 #ifndef MOJO_SYSTEM_DATA_PIPE_H_ |
6 #define MOJO_SYSTEM_DATA_PIPE_H_ | 6 #define MOJO_SYSTEM_DATA_PIPE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // this via |ValidateCreateOptions()| with a null |in_options|; this is | 36 // this via |ValidateCreateOptions()| with a null |in_options|; this is |
37 // exposed directly for testing convenience.) | 37 // exposed directly for testing convenience.) |
38 static const MojoCreateDataPipeOptions kDefaultCreateOptions; | 38 static const MojoCreateDataPipeOptions kDefaultCreateOptions; |
39 | 39 |
40 // Validates and/or sets default options for |MojoCreateDataPipeOptions|. If | 40 // Validates and/or sets default options for |MojoCreateDataPipeOptions|. If |
41 // non-null, |in_options| must point to a struct of at least | 41 // non-null, |in_options| must point to a struct of at least |
42 // |in_options->struct_size| bytes. |out_options| must point to a (current) | 42 // |in_options->struct_size| bytes. |out_options| must point to a (current) |
43 // |MojoCreateDataPipeOptions| and will be entirely overwritten on success (it | 43 // |MojoCreateDataPipeOptions| and will be entirely overwritten on success (it |
44 // may be partly overwritten on failure). | 44 // may be partly overwritten on failure). |
45 static MojoResult ValidateCreateOptions( | 45 static MojoResult ValidateCreateOptions( |
46 const MojoCreateDataPipeOptions* in_options, | 46 UserPointer<const MojoCreateDataPipeOptions> in_options, |
47 MojoCreateDataPipeOptions* out_options); | 47 MojoCreateDataPipeOptions* out_options); |
48 | 48 |
49 // These are called by the producer dispatcher to implement its methods of | 49 // These are called by the producer dispatcher to implement its methods of |
50 // corresponding names. | 50 // corresponding names. |
51 void ProducerCancelAllWaiters(); | 51 void ProducerCancelAllWaiters(); |
52 void ProducerClose(); | 52 void ProducerClose(); |
53 MojoResult ProducerWriteData(UserPointer<const void> elements, | 53 MojoResult ProducerWriteData(UserPointer<const void> elements, |
54 UserPointer<uint32_t> num_bytes, | 54 UserPointer<uint32_t> num_bytes, |
55 bool all_or_none); | 55 bool all_or_none); |
56 MojoResult ProducerBeginWriteData(UserPointer<void*> buffer, | 56 MojoResult ProducerBeginWriteData(UserPointer<void*> buffer, |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 uint32_t producer_two_phase_max_num_bytes_written_; | 201 uint32_t producer_two_phase_max_num_bytes_written_; |
202 uint32_t consumer_two_phase_max_num_bytes_read_; | 202 uint32_t consumer_two_phase_max_num_bytes_read_; |
203 | 203 |
204 DISALLOW_COPY_AND_ASSIGN(DataPipe); | 204 DISALLOW_COPY_AND_ASSIGN(DataPipe); |
205 }; | 205 }; |
206 | 206 |
207 } // namespace system | 207 } // namespace system |
208 } // namespace mojo | 208 } // namespace mojo |
209 | 209 |
210 #endif // MOJO_SYSTEM_DATA_PIPE_H_ | 210 #endif // MOJO_SYSTEM_DATA_PIPE_H_ |
OLD | NEW |