OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This file provides a C++ wrapping around the Mojo C API for data pipes, | 5 // This file provides a C++ wrapping around the Mojo C API for data pipes, |
6 // replacing the prefix of "Mojo" with a "mojo" namespace, and using more | 6 // replacing the prefix of "Mojo" with a "mojo" namespace, and using more |
7 // strongly-typed representations of |MojoHandle|s. | 7 // strongly-typed representations of |MojoHandle|s. |
8 // | 8 // |
9 // Please see "third_party/mojo/src/mojo/public/c/system/data_pipe.h" for comple
te documentation of | 9 // Please see "mojo/public/c/system/data_pipe.h" for complete documentation of |
10 // the API. | 10 // the API. |
11 | 11 |
12 #ifndef THIRD_PARTY_MOJO_SRC_MOJO_PUBLIC_CPP_SYSTEM_DATA_PIPE_H_ | 12 #ifndef MOJO_PUBLIC_CPP_SYSTEM_DATA_PIPE_H_ |
13 #define THIRD_PARTY_MOJO_SRC_MOJO_PUBLIC_CPP_SYSTEM_DATA_PIPE_H_ | 13 #define MOJO_PUBLIC_CPP_SYSTEM_DATA_PIPE_H_ |
14 | 14 |
15 #include <assert.h> | 15 #include <assert.h> |
16 | 16 |
17 #include "third_party/mojo/src/mojo/public/c/system/data_pipe.h" | 17 #include "mojo/public/c/system/data_pipe.h" |
18 #include "third_party/mojo/src/mojo/public/cpp/system/handle.h" | 18 #include "mojo/public/cpp/system/handle.h" |
19 #include "third_party/mojo/src/mojo/public/cpp/system/macros.h" | 19 #include "mojo/public/cpp/system/macros.h" |
20 | 20 |
21 namespace mojo { | 21 namespace mojo { |
22 | 22 |
23 // A strongly-typed representation of a |MojoHandle| to the producer end of a | 23 // A strongly-typed representation of a |MojoHandle| to the producer end of a |
24 // data pipe. | 24 // data pipe. |
25 class DataPipeProducerHandle : public Handle { | 25 class DataPipeProducerHandle : public Handle { |
26 public: | 26 public: |
27 DataPipeProducerHandle() {} | 27 DataPipeProducerHandle() {} |
28 explicit DataPipeProducerHandle(MojoHandle value) : Handle(value) {} | 28 explicit DataPipeProducerHandle(MojoHandle value) : Handle(value) {} |
29 | 29 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 CreateDataPipe(&options, &producer_handle, &consumer_handle); | 152 CreateDataPipe(&options, &producer_handle, &consumer_handle); |
153 MOJO_ALLOW_UNUSED_LOCAL(result); | 153 MOJO_ALLOW_UNUSED_LOCAL(result); |
154 assert(result == MOJO_RESULT_OK); | 154 assert(result == MOJO_RESULT_OK); |
155 } | 155 } |
156 | 156 |
157 inline DataPipe::~DataPipe() { | 157 inline DataPipe::~DataPipe() { |
158 } | 158 } |
159 | 159 |
160 } // namespace mojo | 160 } // namespace mojo |
161 | 161 |
162 #endif // THIRD_PARTY_MOJO_SRC_MOJO_PUBLIC_CPP_SYSTEM_DATA_PIPE_H_ | 162 #endif // MOJO_PUBLIC_CPP_SYSTEM_DATA_PIPE_H_ |
OLD | NEW |