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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 MojoResult MojoSystemImplDuplicateBufferHandle( | 179 MojoResult MojoSystemImplDuplicateBufferHandle( |
180 MojoSystemImpl system, | 180 MojoSystemImpl system, |
181 MojoHandle buffer_handle, | 181 MojoHandle buffer_handle, |
182 const struct MojoDuplicateBufferHandleOptions* options, | 182 const struct MojoDuplicateBufferHandleOptions* options, |
183 MojoHandle* new_buffer_handle) { | 183 MojoHandle* new_buffer_handle) { |
184 assert(g_system_impl_thunks.DuplicateBufferHandle); | 184 assert(g_system_impl_thunks.DuplicateBufferHandle); |
185 return g_system_impl_thunks.DuplicateBufferHandle(system, buffer_handle, | 185 return g_system_impl_thunks.DuplicateBufferHandle(system, buffer_handle, |
186 options, new_buffer_handle); | 186 options, new_buffer_handle); |
187 } | 187 } |
188 | 188 |
| 189 MojoResult MojoSystemImplGetBufferInformation( |
| 190 MojoSystemImpl system, |
| 191 MojoHandle buffer_handle, |
| 192 struct MojoBufferInformation* info, |
| 193 uint32_t info_num_bytes) { |
| 194 assert(g_system_impl_thunks.GetBufferInformation); |
| 195 return g_system_impl_thunks.GetBufferInformation(system, buffer_handle, info, |
| 196 info_num_bytes); |
| 197 } |
| 198 |
189 MojoResult MojoSystemImplMapBuffer(MojoSystemImpl system, | 199 MojoResult MojoSystemImplMapBuffer(MojoSystemImpl system, |
190 MojoHandle buffer_handle, | 200 MojoHandle buffer_handle, |
191 uint64_t offset, | 201 uint64_t offset, |
192 uint64_t num_bytes, | 202 uint64_t num_bytes, |
193 void** buffer, | 203 void** buffer, |
194 MojoMapBufferFlags flags) { | 204 MojoMapBufferFlags flags) { |
195 assert(g_system_impl_thunks.MapBuffer); | 205 assert(g_system_impl_thunks.MapBuffer); |
196 return g_system_impl_thunks.MapBuffer(system, buffer_handle, offset, | 206 return g_system_impl_thunks.MapBuffer(system, buffer_handle, offset, |
197 num_bytes, buffer, flags); | 207 num_bytes, buffer, flags); |
198 } | 208 } |
199 | 209 |
200 MojoResult MojoSystemImplUnmapBuffer(MojoSystemImpl system, void* buffer) { | 210 MojoResult MojoSystemImplUnmapBuffer(MojoSystemImpl system, void* buffer) { |
201 assert(g_system_impl_thunks.UnmapBuffer); | 211 assert(g_system_impl_thunks.UnmapBuffer); |
202 return g_system_impl_thunks.UnmapBuffer(system, buffer); | 212 return g_system_impl_thunks.UnmapBuffer(system, buffer); |
203 } | 213 } |
204 | 214 |
205 THUNK_EXPORT size_t MojoSetSystemImplControlThunksPrivate( | 215 THUNK_EXPORT size_t MojoSetSystemImplControlThunksPrivate( |
206 const struct MojoSystemImplControlThunksPrivate* system_thunks) { | 216 const struct MojoSystemImplControlThunksPrivate* system_thunks) { |
207 if (system_thunks->size >= sizeof(g_system_impl_control_thunks)) | 217 if (system_thunks->size >= sizeof(g_system_impl_control_thunks)) |
208 g_system_impl_control_thunks = *system_thunks; | 218 g_system_impl_control_thunks = *system_thunks; |
209 return sizeof(g_system_impl_control_thunks); | 219 return sizeof(g_system_impl_control_thunks); |
210 } | 220 } |
211 | 221 |
212 THUNK_EXPORT size_t MojoSetSystemImplThunksPrivate( | 222 THUNK_EXPORT size_t MojoSetSystemImplThunksPrivate( |
213 const struct MojoSystemImplThunksPrivate* system_thunks) { | 223 const struct MojoSystemImplThunksPrivate* system_thunks) { |
214 if (system_thunks->size >= sizeof(g_system_impl_thunks)) | 224 if (system_thunks->size >= sizeof(g_system_impl_thunks)) |
215 g_system_impl_thunks = *system_thunks; | 225 g_system_impl_thunks = *system_thunks; |
216 return sizeof(g_system_impl_thunks); | 226 return sizeof(g_system_impl_thunks); |
217 } | 227 } |
OLD | NEW |