| 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_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ | 7 #ifndef MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ |
| 8 #define MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ | 8 #define MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // the embedder. | 33 // the embedder. |
| 34 // This is the ABI between the embedder and the DSO. It can only have new | 34 // This is the ABI between the embedder and the DSO. It can only have new |
| 35 // functions added to the end. No other changes are supported. | 35 // functions added to the end. No other changes are supported. |
| 36 #pragma pack(push, 8) | 36 #pragma pack(push, 8) |
| 37 struct MojoSystemThunks { | 37 struct MojoSystemThunks { |
| 38 size_t size; // Should be set to sizeof(MojoSystemThunks). | 38 size_t size; // Should be set to sizeof(MojoSystemThunks). |
| 39 MojoTimeTicks (*GetTimeTicksNow)(); | 39 MojoTimeTicks (*GetTimeTicksNow)(); |
| 40 MojoResult (*Close)(MojoHandle handle); | 40 MojoResult (*Close)(MojoHandle handle); |
| 41 MojoResult (*Wait)(MojoHandle handle, | 41 MojoResult (*Wait)(MojoHandle handle, |
| 42 MojoHandleSignals signals, | 42 MojoHandleSignals signals, |
| 43 MojoDeadline deadline); | 43 MojoDeadline deadline, |
| 44 struct MojoHandleSignalsState* signals_state); |
| 44 MojoResult (*WaitMany)(const MojoHandle* handles, | 45 MojoResult (*WaitMany)(const MojoHandle* handles, |
| 45 const MojoHandleSignals* signals, | 46 const MojoHandleSignals* signals, |
| 46 uint32_t num_handles, | 47 uint32_t num_handles, |
| 47 MojoDeadline deadline); | 48 MojoDeadline deadline, |
| 48 MojoResult (*NewWait)(MojoHandle handle, | 49 uint32_t* result_index, |
| 49 MojoHandleSignals signals, | 50 struct MojoHandleSignalsState* signals_states); |
| 50 MojoDeadline deadline, | |
| 51 struct MojoHandleSignalsState* signals_state); | |
| 52 MojoResult (*NewWaitMany)(const MojoHandle* handles, | |
| 53 const MojoHandleSignals* signals, | |
| 54 uint32_t num_handles, | |
| 55 MojoDeadline deadline, | |
| 56 uint32_t* result_index, | |
| 57 struct MojoHandleSignalsState* signals_states); | |
| 58 MojoResult (*CreateMessagePipe)( | 51 MojoResult (*CreateMessagePipe)( |
| 59 const struct MojoCreateMessagePipeOptions* options, | 52 const struct MojoCreateMessagePipeOptions* options, |
| 60 MojoHandle* message_pipe_handle0, | 53 MojoHandle* message_pipe_handle0, |
| 61 MojoHandle* message_pipe_handle1); | 54 MojoHandle* message_pipe_handle1); |
| 62 MojoResult (*WriteMessage)(MojoHandle message_pipe_handle, | 55 MojoResult (*WriteMessage)(MojoHandle message_pipe_handle, |
| 63 const void* bytes, | 56 const void* bytes, |
| 64 uint32_t num_bytes, | 57 uint32_t num_bytes, |
| 65 const MojoHandle* handles, | 58 const MojoHandle* handles, |
| 66 uint32_t num_handles, | 59 uint32_t num_handles, |
| 67 MojoWriteMessageFlags flags); | 60 MojoWriteMessageFlags flags); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 107 |
| 115 #ifdef __cplusplus | 108 #ifdef __cplusplus |
| 116 // Intended to be called from the embedder. Returns a |MojoCore| initialized | 109 // Intended to be called from the embedder. Returns a |MojoCore| initialized |
| 117 // to contain pointers to each of the embedder's MojoCore functions. | 110 // to contain pointers to each of the embedder's MojoCore functions. |
| 118 inline MojoSystemThunks MojoMakeSystemThunks() { | 111 inline MojoSystemThunks MojoMakeSystemThunks() { |
| 119 MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks), | 112 MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks), |
| 120 MojoGetTimeTicksNow, | 113 MojoGetTimeTicksNow, |
| 121 MojoClose, | 114 MojoClose, |
| 122 MojoWait, | 115 MojoWait, |
| 123 MojoWaitMany, | 116 MojoWaitMany, |
| 124 MojoNewWait, | |
| 125 MojoNewWaitMany, | |
| 126 MojoCreateMessagePipe, | 117 MojoCreateMessagePipe, |
| 127 MojoWriteMessage, | 118 MojoWriteMessage, |
| 128 MojoReadMessage, | 119 MojoReadMessage, |
| 129 MojoCreateDataPipe, | 120 MojoCreateDataPipe, |
| 130 MojoWriteData, | 121 MojoWriteData, |
| 131 MojoBeginWriteData, | 122 MojoBeginWriteData, |
| 132 MojoEndWriteData, | 123 MojoEndWriteData, |
| 133 MojoReadData, | 124 MojoReadData, |
| 134 MojoBeginReadData, | 125 MojoBeginReadData, |
| 135 MojoEndReadData, | 126 MojoEndReadData, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 146 // a DSO linked with mojo_system. For example: | 137 // a DSO linked with mojo_system. For example: |
| 147 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = | 138 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = |
| 148 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( | 139 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( |
| 149 // "MojoSetSystemThunks")); | 140 // "MojoSetSystemThunks")); |
| 150 // The expected size of |system_thunks} is returned. | 141 // The expected size of |system_thunks} is returned. |
| 151 // The contents of |system_thunks| are copied. | 142 // The contents of |system_thunks| are copied. |
| 152 typedef size_t (*MojoSetSystemThunksFn)( | 143 typedef size_t (*MojoSetSystemThunksFn)( |
| 153 const struct MojoSystemThunks* system_thunks); | 144 const struct MojoSystemThunks* system_thunks); |
| 154 | 145 |
| 155 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ | 146 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ |
| OLD | NEW |