| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 186 } |
| 187 | 187 |
| 188 MojoResult MojoSystemImplEndWriteData(MojoSystemImpl system, | 188 MojoResult MojoSystemImplEndWriteData(MojoSystemImpl system, |
| 189 MojoHandle data_pipe_producer_handle, | 189 MojoHandle data_pipe_producer_handle, |
| 190 uint32_t num_elements_written) { | 190 uint32_t num_elements_written) { |
| 191 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); | 191 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
| 192 DCHECK(core); | 192 DCHECK(core); |
| 193 return core->EndWriteData(data_pipe_producer_handle, num_elements_written); | 193 return core->EndWriteData(data_pipe_producer_handle, num_elements_written); |
| 194 } | 194 } |
| 195 | 195 |
| 196 MojoResult MojoSystemImplSetDataPipeConsumerOptions( |
| 197 MojoSystemImpl system, |
| 198 MojoHandle data_pipe_consumer_handle, |
| 199 const struct MojoDataPipeConsumerOptions* options) { |
| 200 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
| 201 DCHECK(core); |
| 202 return core->SetDataPipeConsumerOptions(data_pipe_consumer_handle, |
| 203 MakeUserPointer(options)); |
| 204 } |
| 205 |
| 206 MojoResult MojoSystemImplGetDataPipeConsumerOptions( |
| 207 MojoSystemImpl system, |
| 208 MojoHandle data_pipe_consumer_handle, |
| 209 struct MojoDataPipeConsumerOptions* options, |
| 210 uint32_t options_num_bytes) { |
| 211 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
| 212 DCHECK(core); |
| 213 return core->GetDataPipeConsumerOptions( |
| 214 data_pipe_consumer_handle, MakeUserPointer(options), options_num_bytes); |
| 215 } |
| 216 |
| 196 MojoResult MojoSystemImplReadData(MojoSystemImpl system, | 217 MojoResult MojoSystemImplReadData(MojoSystemImpl system, |
| 197 MojoHandle data_pipe_consumer_handle, | 218 MojoHandle data_pipe_consumer_handle, |
| 198 void* elements, | 219 void* elements, |
| 199 uint32_t* num_elements, | 220 uint32_t* num_elements, |
| 200 MojoReadDataFlags flags) { | 221 MojoReadDataFlags flags) { |
| 201 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); | 222 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
| 202 DCHECK(core); | 223 DCHECK(core); |
| 203 return core->ReadData(data_pipe_consumer_handle, MakeUserPointer(elements), | 224 return core->ReadData(data_pipe_consumer_handle, MakeUserPointer(elements), |
| 204 MakeUserPointer(num_elements), flags); | 225 MakeUserPointer(num_elements), flags); |
| 205 } | 226 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 MakeUserPointer(buffer), flags); | 288 MakeUserPointer(buffer), flags); |
| 268 } | 289 } |
| 269 | 290 |
| 270 MojoResult MojoSystemImplUnmapBuffer(MojoSystemImpl system, void* buffer) { | 291 MojoResult MojoSystemImplUnmapBuffer(MojoSystemImpl system, void* buffer) { |
| 271 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); | 292 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
| 272 DCHECK(core); | 293 DCHECK(core); |
| 273 return core->UnmapBuffer(MakeUserPointer(buffer)); | 294 return core->UnmapBuffer(MakeUserPointer(buffer)); |
| 274 } | 295 } |
| 275 | 296 |
| 276 } // extern "C" | 297 } // extern "C" |
| OLD | NEW |