Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: mojo/public/platform/native/system_thunks.h

Issue 1461213002: WaitSet implementation for old EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-waitset-skeleton
Patch Set: Fix windows build and style issues. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/public/c/system/wait_set.h ('k') | mojo/public/platform/native/system_thunks.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 MojoResult (*DuplicateBufferHandle)( 94 MojoResult (*DuplicateBufferHandle)(
95 MojoHandle buffer_handle, 95 MojoHandle buffer_handle,
96 const struct MojoDuplicateBufferHandleOptions* options, 96 const struct MojoDuplicateBufferHandleOptions* options,
97 MojoHandle* new_buffer_handle); 97 MojoHandle* new_buffer_handle);
98 MojoResult (*MapBuffer)(MojoHandle buffer_handle, 98 MojoResult (*MapBuffer)(MojoHandle buffer_handle,
99 uint64_t offset, 99 uint64_t offset,
100 uint64_t num_bytes, 100 uint64_t num_bytes,
101 void** buffer, 101 void** buffer,
102 MojoMapBufferFlags flags); 102 MojoMapBufferFlags flags);
103 MojoResult (*UnmapBuffer)(void* buffer); 103 MojoResult (*UnmapBuffer)(void* buffer);
104
105 MojoResult (*CreateWaitSet)(MojoHandle* wait_set);
106 MojoResult (*AddHandle)(MojoHandle wait_set,
107 MojoHandle handle,
108 MojoHandleSignals signals);
109 MojoResult (*RemoveHandle)(MojoHandle wait_set,
110 MojoHandle handle);
111 MojoResult (*GetReadyHandles)(MojoHandle wait_set,
112 uint32_t* count,
113 MojoHandle* handles,
114 MojoResult* results,
115 struct MojoHandleSignalsState* signals_states);
104 }; 116 };
105 #pragma pack(pop) 117 #pragma pack(pop)
106 118
107 119
108 #ifdef __cplusplus 120 #ifdef __cplusplus
109 // Intended to be called from the embedder. Returns a |MojoCore| initialized 121 // Intended to be called from the embedder. Returns a |MojoCore| initialized
110 // to contain pointers to each of the embedder's MojoCore functions. 122 // to contain pointers to each of the embedder's MojoCore functions.
111 inline MojoSystemThunks MojoMakeSystemThunks() { 123 inline MojoSystemThunks MojoMakeSystemThunks() {
112 MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks), 124 MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks),
113 MojoGetTimeTicksNow, 125 MojoGetTimeTicksNow,
114 MojoClose, 126 MojoClose,
115 MojoWait, 127 MojoWait,
116 MojoWaitMany, 128 MojoWaitMany,
117 MojoCreateMessagePipe, 129 MojoCreateMessagePipe,
118 MojoWriteMessage, 130 MojoWriteMessage,
119 MojoReadMessage, 131 MojoReadMessage,
120 MojoCreateDataPipe, 132 MojoCreateDataPipe,
121 MojoWriteData, 133 MojoWriteData,
122 MojoBeginWriteData, 134 MojoBeginWriteData,
123 MojoEndWriteData, 135 MojoEndWriteData,
124 MojoReadData, 136 MojoReadData,
125 MojoBeginReadData, 137 MojoBeginReadData,
126 MojoEndReadData, 138 MojoEndReadData,
127 MojoCreateSharedBuffer, 139 MojoCreateSharedBuffer,
128 MojoDuplicateBufferHandle, 140 MojoDuplicateBufferHandle,
129 MojoMapBuffer, 141 MojoMapBuffer,
130 MojoUnmapBuffer}; 142 MojoUnmapBuffer,
143 MojoCreateWaitSet,
144 MojoAddHandle,
145 MojoRemoveHandle,
146 MojoGetReadyHandles};
131 return system_thunks; 147 return system_thunks;
132 } 148 }
133 #endif 149 #endif
134 150
135 151
136 // Use this type for the function found by dynamically discovering it in 152 // Use this type for the function found by dynamically discovering it in
137 // a DSO linked with mojo_system. For example: 153 // a DSO linked with mojo_system. For example:
138 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = 154 // MojoSetSystemThunksFn mojo_set_system_thunks_fn =
139 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( 155 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer(
140 // "MojoSetSystemThunks")); 156 // "MojoSetSystemThunks"));
141 // The expected size of |system_thunks} is returned. 157 // The expected size of |system_thunks} is returned.
142 // The contents of |system_thunks| are copied. 158 // The contents of |system_thunks| are copied.
143 typedef size_t (*MojoSetSystemThunksFn)( 159 typedef size_t (*MojoSetSystemThunksFn)(
144 const struct MojoSystemThunks* system_thunks); 160 const struct MojoSystemThunks* system_thunks);
145 161
146 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ 162 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_
OLDNEW
« no previous file with comments | « mojo/public/c/system/wait_set.h ('k') | mojo/public/platform/native/system_thunks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698