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

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

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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "mojo/public/platform/native/system_thunks.h" 5 #include "mojo/public/platform/native/system_thunks.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 8
9 #include "mojo/public/platform/native/thunk_export.h" 9 #include "mojo/public/platform/native/thunk_export.h"
10 10
11 static struct MojoSystemThunks g_thunks = {0}; 11 static struct MojoSystemThunks g_thunks = {0};
12 12
13 MojoTimeTicks MojoGetTimeTicksNow() { 13 MojoTimeTicks MojoGetTimeTicksNow() {
14 assert(g_thunks.GetTimeTicksNow); 14 assert(g_thunks.GetTimeTicksNow);
15 return g_thunks.GetTimeTicksNow(); 15 return g_thunks.GetTimeTicksNow();
16 } 16 }
17 17
18 MojoResult MojoClose(MojoHandle handle) { 18 MojoResult MojoClose(MojoHandle handle) {
19 assert(g_thunks.Close); 19 assert(g_thunks.Close);
20 return g_thunks.Close(handle); 20 return g_thunks.Close(handle);
21 } 21 }
22 22
23 MojoResult MojoGetRights(MojoHandle handle, MojoHandleRights* rights) { 23 MojoResult MojoGetRights(MojoHandle handle, MojoHandleRights* rights) {
24 assert(g_thunks.GetRights); 24 assert(g_thunks.GetRights);
25 return g_thunks.GetRights(handle, rights); 25 return g_thunks.GetRights(handle, rights);
26 } 26 }
27 27
28 MojoResult MojoReplaceHandleWithReducedRights(
29 MojoHandle handle,
30 MojoHandleRights rights_to_remove,
31 MojoHandle* replacement_handle) {
32 assert(g_thunks.ReplaceHandleWithReducedRights);
33 return g_thunks.ReplaceHandleWithReducedRights(
34 handle, rights_to_remove, replacement_handle);
35 }
36
28 MojoResult MojoDuplicateHandleWithReducedRights( 37 MojoResult MojoDuplicateHandleWithReducedRights(
29 MojoHandle handle, 38 MojoHandle handle,
30 MojoHandleRights rights_to_remove, 39 MojoHandleRights rights_to_remove,
31 MojoHandle* new_handle) { 40 MojoHandle* new_handle) {
32 assert(g_thunks.DuplicateHandleWithReducedRights); 41 assert(g_thunks.DuplicateHandleWithReducedRights);
33 return g_thunks.DuplicateHandleWithReducedRights(handle, rights_to_remove, 42 return g_thunks.DuplicateHandleWithReducedRights(handle, rights_to_remove,
34 new_handle); 43 new_handle);
35 } 44 }
36 45
37 MojoResult MojoDuplicateHandle(MojoHandle handle, MojoHandle* new_handle) { 46 MojoResult MojoDuplicateHandle(MojoHandle handle, MojoHandle* new_handle) {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 assert(g_thunks.UnmapBuffer); 225 assert(g_thunks.UnmapBuffer);
217 return g_thunks.UnmapBuffer(buffer); 226 return g_thunks.UnmapBuffer(buffer);
218 } 227 }
219 228
220 THUNK_EXPORT size_t 229 THUNK_EXPORT size_t
221 MojoSetSystemThunks(const struct MojoSystemThunks* system_thunks) { 230 MojoSetSystemThunks(const struct MojoSystemThunks* system_thunks) {
222 if (system_thunks->size >= sizeof(g_thunks)) 231 if (system_thunks->size >= sizeof(g_thunks))
223 g_thunks = *system_thunks; 232 g_thunks = *system_thunks;
224 return sizeof(g_thunks); 233 return sizeof(g_thunks);
225 } 234 }
OLDNEW
« mojo/nacl/sfi/nacl_bindings/mojo_irt.c ('K') | « mojo/public/platform/native/system_thunks.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698