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

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

Issue 2000253002: Add thunks for MojoDuplicateHandle[WithReducedRights](). (Closed) Base URL: https://github.com/domokit/mojo.git@work792_dup_handle_1
Patch Set: Created 4 years, 6 months 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
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 struct MojoDataPipeConsumerOptions* options, 120 struct MojoDataPipeConsumerOptions* options,
121 uint32_t options_num_bytes); 121 uint32_t options_num_bytes);
122 MojoResult (*SetDataPipeProducerOptions)( 122 MojoResult (*SetDataPipeProducerOptions)(
123 MojoHandle data_pipe_producer_handle, 123 MojoHandle data_pipe_producer_handle,
124 const struct MojoDataPipeProducerOptions* options); 124 const struct MojoDataPipeProducerOptions* options);
125 MojoResult (*GetDataPipeProducerOptions)( 125 MojoResult (*GetDataPipeProducerOptions)(
126 MojoHandle data_pipe_producer_handle, 126 MojoHandle data_pipe_producer_handle,
127 struct MojoDataPipeProducerOptions* options, 127 struct MojoDataPipeProducerOptions* options,
128 uint32_t options_num_bytes); 128 uint32_t options_num_bytes);
129 MojoResult (*GetRights)(MojoHandle handle, MojoHandleRights* rights); 129 MojoResult (*GetRights)(MojoHandle handle, MojoHandleRights* rights);
130 MojoResult (*DuplicateHandleWithReducedRights)(
131 MojoHandle handle,
132 MojoHandleRights rights_to_remove,
133 MojoHandle* new_handle);
134 MojoResult (*DuplicateHandle)(MojoHandle handle, MojoHandle* new_handle);
130 }; 135 };
131 #pragma pack(pop) 136 #pragma pack(pop)
132 137
133 138
134 #ifdef __cplusplus 139 #ifdef __cplusplus
135 // Intended to be called from the embedder. Returns a |MojoCore| initialized 140 // Intended to be called from the embedder. Returns a |MojoCore| initialized
136 // to contain pointers to each of the embedder's MojoCore functions. 141 // to contain pointers to each of the embedder's MojoCore functions.
137 inline MojoSystemThunks MojoMakeSystemThunks() { 142 inline MojoSystemThunks MojoMakeSystemThunks() {
138 MojoSystemThunks system_thunks = { 143 MojoSystemThunks system_thunks = {
139 sizeof(MojoSystemThunks), 144 sizeof(MojoSystemThunks),
(...skipping 14 matching lines...) Expand all
154 MojoCreateSharedBuffer, 159 MojoCreateSharedBuffer,
155 MojoDuplicateBufferHandle, 160 MojoDuplicateBufferHandle,
156 MojoMapBuffer, 161 MojoMapBuffer,
157 MojoUnmapBuffer, 162 MojoUnmapBuffer,
158 MojoGetBufferInformation, 163 MojoGetBufferInformation,
159 MojoSetDataPipeConsumerOptions, 164 MojoSetDataPipeConsumerOptions,
160 MojoGetDataPipeConsumerOptions, 165 MojoGetDataPipeConsumerOptions,
161 MojoSetDataPipeProducerOptions, 166 MojoSetDataPipeProducerOptions,
162 MojoGetDataPipeProducerOptions, 167 MojoGetDataPipeProducerOptions,
163 MojoGetRights, 168 MojoGetRights,
169 MojoDuplicateHandleWithReducedRights,
170 MojoDuplicateHandle,
164 }; 171 };
165 return system_thunks; 172 return system_thunks;
166 } 173 }
167 #endif 174 #endif
168 175
169 176
170 // Use this type for the function found by dynamically discovering it in 177 // Use this type for the function found by dynamically discovering it in
171 // a DSO linked with mojo_system. For example: 178 // a DSO linked with mojo_system. For example:
172 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = 179 // MojoSetSystemThunksFn mojo_set_system_thunks_fn =
173 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( 180 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer(
174 // "MojoSetSystemThunks")); 181 // "MojoSetSystemThunks"));
175 // The expected size of |system_thunks} is returned. 182 // The expected size of |system_thunks} is returned.
176 // The contents of |system_thunks| are copied. 183 // The contents of |system_thunks| are copied.
177 typedef size_t (*MojoSetSystemThunksFn)( 184 typedef size_t (*MojoSetSystemThunksFn)(
178 const struct MojoSystemThunks* system_thunks); 185 const struct MojoSystemThunks* system_thunks);
179 186
180 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ 187 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_
OLDNEW
« no previous file with comments | « mojo/public/platform/native/system_impl_private_unittest.cc ('k') | mojo/public/platform/native/system_thunks.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698