| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_thunks.h" | 5 #include "mojo/public/platform/native/system_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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 MojoMapBufferFlags flags) { | 151 MojoMapBufferFlags flags) { |
| 152 assert(g_thunks.MapBuffer); | 152 assert(g_thunks.MapBuffer); |
| 153 return g_thunks.MapBuffer(buffer_handle, offset, num_bytes, buffer, flags); | 153 return g_thunks.MapBuffer(buffer_handle, offset, num_bytes, buffer, flags); |
| 154 } | 154 } |
| 155 | 155 |
| 156 MojoResult MojoUnmapBuffer(void* buffer) { | 156 MojoResult MojoUnmapBuffer(void* buffer) { |
| 157 assert(g_thunks.UnmapBuffer); | 157 assert(g_thunks.UnmapBuffer); |
| 158 return g_thunks.UnmapBuffer(buffer); | 158 return g_thunks.UnmapBuffer(buffer); |
| 159 } | 159 } |
| 160 | 160 |
| 161 MojoResult MojoCreateWaitSet(MojoHandle* wait_set) { |
| 162 assert(g_thunks.CreateWaitSet); |
| 163 return g_thunks.CreateWaitSet(wait_set); |
| 164 } |
| 165 |
| 166 MojoResult MojoAddHandle(MojoHandle wait_set, |
| 167 MojoHandle handle, |
| 168 MojoHandleSignals signals) { |
| 169 assert(g_thunks.AddHandle); |
| 170 return g_thunks.AddHandle(wait_set, handle, signals); |
| 171 } |
| 172 |
| 173 MojoResult MojoRemoveHandle(MojoHandle wait_set, MojoHandle handle) { |
| 174 assert(g_thunks.RemoveHandle); |
| 175 return g_thunks.RemoveHandle(wait_set, handle); |
| 176 } |
| 177 |
| 178 MojoResult MojoGetReadyHandles(MojoHandle wait_set, |
| 179 uint32_t* count, |
| 180 MojoHandle* handles, |
| 181 MojoResult* results, |
| 182 struct MojoHandleSignalsState* signals_states) { |
| 183 assert(g_thunks.GetReadyHandles); |
| 184 return g_thunks.GetReadyHandles(wait_set, count, handles, results, |
| 185 signals_states); |
| 186 } |
| 187 |
| 161 extern "C" THUNK_EXPORT size_t MojoSetSystemThunks( | 188 extern "C" THUNK_EXPORT size_t MojoSetSystemThunks( |
| 162 const MojoSystemThunks* system_thunks) { | 189 const MojoSystemThunks* system_thunks) { |
| 163 if (system_thunks->size >= sizeof(g_thunks)) | 190 if (system_thunks->size >= sizeof(g_thunks)) |
| 164 g_thunks = *system_thunks; | 191 g_thunks = *system_thunks; |
| 165 return sizeof(g_thunks); | 192 return sizeof(g_thunks); |
| 166 } | 193 } |
| 167 | 194 |
| 168 } // extern "C" | 195 } // extern "C" |
| OLD | NEW |