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

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

Issue 2056513002: Plumb MojoReplaceHandleWithReducedRights() out. (Closed) Base URL: https://github.com/domokit/mojo.git@work790_replace_reduce_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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
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)( 130 MojoResult (*DuplicateHandleWithReducedRights)(
131 MojoHandle handle, 131 MojoHandle handle,
132 MojoHandleRights rights_to_remove, 132 MojoHandleRights rights_to_remove,
133 MojoHandle* new_handle); 133 MojoHandle* new_handle);
134 MojoResult (*DuplicateHandle)(MojoHandle handle, MojoHandle* new_handle); 134 MojoResult (*DuplicateHandle)(MojoHandle handle, MojoHandle* new_handle);
135 MojoResult (*ReplaceHandleWithReducedRights)(
136 MojoHandle handle,
137 MojoHandleRights rights_to_remove,
138 MojoHandle* replacement_handle);
135 }; 139 };
136 #pragma pack(pop) 140 #pragma pack(pop)
137 141
138 142
139 #ifdef __cplusplus 143 #ifdef __cplusplus
140 // Intended to be called from the embedder. Returns a |MojoCore| initialized 144 // Intended to be called from the embedder. Returns a |MojoCore| initialized
141 // to contain pointers to each of the embedder's MojoCore functions. 145 // to contain pointers to each of the embedder's MojoCore functions.
142 inline MojoSystemThunks MojoMakeSystemThunks() { 146 inline MojoSystemThunks MojoMakeSystemThunks() {
143 MojoSystemThunks system_thunks = { 147 MojoSystemThunks system_thunks = {
144 sizeof(MojoSystemThunks), 148 sizeof(MojoSystemThunks),
(...skipping 16 matching lines...) Expand all
161 MojoMapBuffer, 165 MojoMapBuffer,
162 MojoUnmapBuffer, 166 MojoUnmapBuffer,
163 MojoGetBufferInformation, 167 MojoGetBufferInformation,
164 MojoSetDataPipeConsumerOptions, 168 MojoSetDataPipeConsumerOptions,
165 MojoGetDataPipeConsumerOptions, 169 MojoGetDataPipeConsumerOptions,
166 MojoSetDataPipeProducerOptions, 170 MojoSetDataPipeProducerOptions,
167 MojoGetDataPipeProducerOptions, 171 MojoGetDataPipeProducerOptions,
168 MojoGetRights, 172 MojoGetRights,
169 MojoDuplicateHandleWithReducedRights, 173 MojoDuplicateHandleWithReducedRights,
170 MojoDuplicateHandle, 174 MojoDuplicateHandle,
175 MojoReplaceHandleWithReducedRights,
171 }; 176 };
172 return system_thunks; 177 return system_thunks;
173 } 178 }
174 #endif 179 #endif
175 180
176 181
177 // Use this type for the function found by dynamically discovering it in 182 // Use this type for the function found by dynamically discovering it in
178 // a DSO linked with mojo_system. For example: 183 // a DSO linked with mojo_system. For example:
179 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = 184 // MojoSetSystemThunksFn mojo_set_system_thunks_fn =
180 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( 185 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer(
181 // "MojoSetSystemThunks")); 186 // "MojoSetSystemThunks"));
182 // The expected size of |system_thunks} is returned. 187 // The expected size of |system_thunks} is returned.
183 // The contents of |system_thunks| are copied. 188 // The contents of |system_thunks| are copied.
184 typedef size_t (*MojoSetSystemThunksFn)( 189 typedef size_t (*MojoSetSystemThunksFn)(
185 const struct MojoSystemThunks* system_thunks); 190 const struct MojoSystemThunks* system_thunks);
186 191
187 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ 192 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698