| 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 "mojo/public/platform/native/system_impl_private_thunks.h" | 5 #include "mojo/public/platform/native/system_impl_private_thunks.h" |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 | 8 |
| 9 #include "mojo/public/platform/native/thunk_export.h" | 9 #include "mojo/public/platform/native/thunk_export.h" |
| 10 | 10 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 | 132 |
| 133 MojoResult MojoSystemImplEndWriteData(MojoSystemImpl system, | 133 MojoResult MojoSystemImplEndWriteData(MojoSystemImpl system, |
| 134 MojoHandle data_pipe_producer_handle, | 134 MojoHandle data_pipe_producer_handle, |
| 135 uint32_t num_elements_written) { | 135 uint32_t num_elements_written) { |
| 136 assert(g_system_impl_thunks.EndWriteData); | 136 assert(g_system_impl_thunks.EndWriteData); |
| 137 return g_system_impl_thunks.EndWriteData(system, data_pipe_producer_handle, | 137 return g_system_impl_thunks.EndWriteData(system, data_pipe_producer_handle, |
| 138 num_elements_written); | 138 num_elements_written); |
| 139 } | 139 } |
| 140 | 140 |
| 141 MojoResult MojoSystemImplSetDataPipeConsumerOptions( |
| 142 MojoSystemImpl system, |
| 143 MojoHandle data_pipe_consumer_handle, |
| 144 const struct MojoDataPipeConsumerOptions* options) { |
| 145 assert(g_system_impl_thunks.SetDataPipeConsumerOptions); |
| 146 return g_system_impl_thunks.SetDataPipeConsumerOptions( |
| 147 system, data_pipe_consumer_handle, options); |
| 148 } |
| 149 |
| 150 MojoResult MojoSystemImplGetDataPipeConsumerOptions( |
| 151 MojoSystemImpl system, |
| 152 MojoHandle data_pipe_consumer_handle, |
| 153 struct MojoDataPipeConsumerOptions* options, |
| 154 uint32_t options_num_bytes) { |
| 155 assert(g_system_impl_thunks.GetDataPipeConsumerOptions); |
| 156 return g_system_impl_thunks.GetDataPipeConsumerOptions( |
| 157 system, data_pipe_consumer_handle, options, options_num_bytes); |
| 158 } |
| 159 |
| 141 MojoResult MojoSystemImplReadData(MojoSystemImpl system, | 160 MojoResult MojoSystemImplReadData(MojoSystemImpl system, |
| 142 MojoHandle data_pipe_consumer_handle, | 161 MojoHandle data_pipe_consumer_handle, |
| 143 void* elements, | 162 void* elements, |
| 144 uint32_t* num_elements, | 163 uint32_t* num_elements, |
| 145 MojoReadDataFlags flags) { | 164 MojoReadDataFlags flags) { |
| 146 assert(g_system_impl_thunks.ReadData); | 165 assert(g_system_impl_thunks.ReadData); |
| 147 return g_system_impl_thunks.ReadData(system, data_pipe_consumer_handle, | 166 return g_system_impl_thunks.ReadData(system, data_pipe_consumer_handle, |
| 148 elements, num_elements, flags); | 167 elements, num_elements, flags); |
| 149 } | 168 } |
| 150 | 169 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 g_system_impl_control_thunks = *system_thunks; | 237 g_system_impl_control_thunks = *system_thunks; |
| 219 return sizeof(g_system_impl_control_thunks); | 238 return sizeof(g_system_impl_control_thunks); |
| 220 } | 239 } |
| 221 | 240 |
| 222 THUNK_EXPORT size_t MojoSetSystemImplThunksPrivate( | 241 THUNK_EXPORT size_t MojoSetSystemImplThunksPrivate( |
| 223 const struct MojoSystemImplThunksPrivate* system_thunks) { | 242 const struct MojoSystemImplThunksPrivate* system_thunks) { |
| 224 if (system_thunks->size >= sizeof(g_system_impl_thunks)) | 243 if (system_thunks->size >= sizeof(g_system_impl_thunks)) |
| 225 g_system_impl_thunks = *system_thunks; | 244 g_system_impl_thunks = *system_thunks; |
| 226 return sizeof(g_system_impl_thunks); | 245 return sizeof(g_system_impl_thunks); |
| 227 } | 246 } |
| OLD | NEW |