OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "base/logging.h" | 5 #include "base/logging.h" |
6 #include "mojo/edk/embedder/embedder_internal.h" | 6 #include "mojo/edk/embedder/embedder_internal.h" |
7 #include "mojo/edk/system/core.h" | 7 #include "mojo/edk/system/core.h" |
8 #include "mojo/edk/system/dispatcher.h" | 8 #include "mojo/edk/system/dispatcher.h" |
9 #include "mojo/edk/util/ref_ptr.h" | 9 #include "mojo/edk/util/ref_ptr.h" |
10 #include "mojo/public/c/system/buffer.h" | 10 #include "mojo/public/c/system/buffer.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 const MojoCreateDataPipeOptions* options, | 155 const MojoCreateDataPipeOptions* options, |
156 MojoHandle* data_pipe_producer_handle, | 156 MojoHandle* data_pipe_producer_handle, |
157 MojoHandle* data_pipe_consumer_handle) { | 157 MojoHandle* data_pipe_consumer_handle) { |
158 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); | 158 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
159 DCHECK(core); | 159 DCHECK(core); |
160 return core->CreateDataPipe(MakeUserPointer(options), | 160 return core->CreateDataPipe(MakeUserPointer(options), |
161 MakeUserPointer(data_pipe_producer_handle), | 161 MakeUserPointer(data_pipe_producer_handle), |
162 MakeUserPointer(data_pipe_consumer_handle)); | 162 MakeUserPointer(data_pipe_consumer_handle)); |
163 } | 163 } |
164 | 164 |
| 165 MojoResult MojoSystemImplSetDataPipeProducerOptions( |
| 166 MojoSystemImpl system, |
| 167 MojoHandle data_pipe_producer_handle, |
| 168 const struct MojoDataPipeProducerOptions* options) { |
| 169 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
| 170 DCHECK(core); |
| 171 return core->SetDataPipeProducerOptions(data_pipe_producer_handle, |
| 172 MakeUserPointer(options)); |
| 173 } |
| 174 |
| 175 MojoResult MojoSystemImplGetDataPipeProducerOptions( |
| 176 MojoSystemImpl system, |
| 177 MojoHandle data_pipe_producer_handle, |
| 178 struct MojoDataPipeProducerOptions* options, |
| 179 uint32_t options_num_bytes) { |
| 180 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
| 181 DCHECK(core); |
| 182 return core->GetDataPipeProducerOptions( |
| 183 data_pipe_producer_handle, MakeUserPointer(options), options_num_bytes); |
| 184 } |
| 185 |
165 MojoResult MojoSystemImplWriteData(MojoSystemImpl system, | 186 MojoResult MojoSystemImplWriteData(MojoSystemImpl system, |
166 MojoHandle data_pipe_producer_handle, | 187 MojoHandle data_pipe_producer_handle, |
167 const void* elements, | 188 const void* elements, |
168 uint32_t* num_elements, | 189 uint32_t* num_elements, |
169 MojoWriteDataFlags flags) { | 190 MojoWriteDataFlags flags) { |
170 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); | 191 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
171 DCHECK(core); | 192 DCHECK(core); |
172 return core->WriteData(data_pipe_producer_handle, MakeUserPointer(elements), | 193 return core->WriteData(data_pipe_producer_handle, MakeUserPointer(elements), |
173 MakeUserPointer(num_elements), flags); | 194 MakeUserPointer(num_elements), flags); |
174 } | 195 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 MakeUserPointer(buffer), flags); | 309 MakeUserPointer(buffer), flags); |
289 } | 310 } |
290 | 311 |
291 MojoResult MojoSystemImplUnmapBuffer(MojoSystemImpl system, void* buffer) { | 312 MojoResult MojoSystemImplUnmapBuffer(MojoSystemImpl system, void* buffer) { |
292 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); | 313 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
293 DCHECK(core); | 314 DCHECK(core); |
294 return core->UnmapBuffer(MakeUserPointer(buffer)); | 315 return core->UnmapBuffer(MakeUserPointer(buffer)); |
295 } | 316 } |
296 | 317 |
297 } // extern "C" | 318 } // extern "C" |
OLD | NEW |