| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Note: This header should be compilable as C. | 5 // Note: This header should be compilable as C. |
| 6 | 6 |
| 7 #ifndef MOJO_PUBLIC_C_SYSTEM_THUNKS_H_ | 7 #ifndef MOJO_PUBLIC_C_SYSTEM_THUNKS_H_ |
| 8 #define MOJO_PUBLIC_C_SYSTEM_THUNKS_H_ | 8 #define MOJO_PUBLIC_C_SYSTEM_THUNKS_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| 11 #include <stdint.h> | 11 #include <stdint.h> |
| 12 | 12 |
| 13 #include "mojo/public/c/system/core.h" | 13 #include "mojo/public/c/system/core.h" |
| 14 #include "mojo/public/c/system/system_export.h" | 14 #include "mojo/public/c/system/system_export.h" |
| 15 | 15 |
| 16 // Structure used to bind the basic Mojo Core functions to an embedder | 16 // Structure used to bind the basic Mojo Core functions to an embedder |
| 17 // implementation. This is intended to eventually be used as a stable ABI | 17 // implementation. This is intended to eventually be used as a stable ABI |
| 18 // between a Mojo embedder and some loaded application code, but for now it is | 18 // between a Mojo embedder and some loaded application code, but for now it is |
| 19 // still effectively safe to rearrange entries as needed. | 19 // still effectively safe to rearrange entries as needed. |
| 20 #pragma pack(push, 8) | 20 #pragma pack(push, 8) |
| 21 struct MojoSystemThunks { | 21 struct MojoSystemThunks { |
| 22 size_t size; // Should be set to sizeof(MojoSystemThunks). | 22 size_t size; // Should be set to sizeof(MojoSystemThunks). |
| 23 MojoTimeTicks (*GetTimeTicksNow)(); | 23 MojoTimeTicks (*GetTimeTicksNow)(); |
| 24 MojoResult (*Close)(MojoHandle handle); | 24 MojoResult (*Close)(MojoHandle handle); |
| 25 MojoResult (*QueryHandleSignalsState)( |
| 26 MojoHandle handle, |
| 27 struct MojoHandleSignalsState* signals_state); |
| 25 MojoResult (*Wait)(MojoHandle handle, | 28 MojoResult (*Wait)(MojoHandle handle, |
| 26 MojoHandleSignals signals, | 29 MojoHandleSignals signals, |
| 27 MojoDeadline deadline, | 30 MojoDeadline deadline, |
| 28 struct MojoHandleSignalsState* signals_state); | 31 struct MojoHandleSignalsState* signals_state); |
| 29 MojoResult (*WaitMany)(const MojoHandle* handles, | 32 MojoResult (*WaitMany)(const MojoHandle* handles, |
| 30 const MojoHandleSignals* signals, | 33 const MojoHandleSignals* signals, |
| 31 uint32_t num_handles, | 34 uint32_t num_handles, |
| 32 MojoDeadline deadline, | 35 MojoDeadline deadline, |
| 33 uint32_t* result_index, | 36 uint32_t* result_index, |
| 34 struct MojoHandleSignalsState* signals_states); | 37 struct MojoHandleSignalsState* signals_states); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // The contents of |system_thunks| are copied. | 161 // The contents of |system_thunks| are copied. |
| 159 typedef size_t (*MojoSetSystemThunksFn)( | 162 typedef size_t (*MojoSetSystemThunksFn)( |
| 160 const struct MojoSystemThunks* system_thunks); | 163 const struct MojoSystemThunks* system_thunks); |
| 161 | 164 |
| 162 // A function for setting up the embedder's own system thunks. This should only | 165 // A function for setting up the embedder's own system thunks. This should only |
| 163 // be called by Mojo embedder code. | 166 // be called by Mojo embedder code. |
| 164 MOJO_SYSTEM_EXPORT size_t MojoEmbedderSetSystemThunks( | 167 MOJO_SYSTEM_EXPORT size_t MojoEmbedderSetSystemThunks( |
| 165 const struct MojoSystemThunks* system_thunks); | 168 const struct MojoSystemThunks* system_thunks); |
| 166 | 169 |
| 167 #endif // MOJO_PUBLIC_C_SYSTEM_THUNKS_H_ | 170 #endif // MOJO_PUBLIC_C_SYSTEM_THUNKS_H_ |
| OLD | NEW |