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 # pylint: disable=F0401 | 5 # pylint: disable=F0401 |
6 | 6 |
7 import interface_dsl | 7 import interface_dsl |
8 | 8 |
9 def MakeInterface(): | 9 def MakeInterface(): |
10 mojo = interface_dsl.Interface() | 10 mojo = interface_dsl.Interface() |
11 | 11 |
12 # This function is not provided by the Mojo system APIs, but instead allows | 12 # This function is not provided by the Mojo system APIs, but instead allows |
13 # trusted code to provide a handle for use by untrusted code. See the | 13 # trusted code to provide a handle for use by untrusted code. See the |
14 # implementation in mojo_syscall.cc.tmpl. | 14 # implementation in mojo_syscall.cc.tmpl. |
15 f = mojo.Func('_MojoGetInitialHandle', 'MojoResult') | 15 f = mojo.Func('_MojoGetInitialHandle', 'MojoResult') |
16 f.Param('handle').Out('MojoHandle') | 16 f.Param('handle').Out('MojoHandle') |
17 | 17 |
18 f = mojo.Func('MojoGetTimeTicksNow', 'MojoTimeTicks') | 18 f = mojo.Func('MojoGetTimeTicksNow', 'MojoTimeTicks') |
19 | 19 |
20 f = mojo.Func('MojoClose', 'MojoResult') | 20 f = mojo.Func('MojoClose', 'MojoResult') |
21 f.Param('handle').In('MojoHandle') | 21 f.Param('handle').In('MojoHandle') |
22 | 22 |
23 f = mojo.Func('MojoGetRights', 'MojoResult') | 23 f = mojo.Func('MojoGetRights', 'MojoResult') |
24 f.Param('handle').In('MojoHandle') | 24 f.Param('handle').In('MojoHandle') |
25 f.Param('rights').Out('MojoHandleRights') | 25 f.Param('rights').Out('MojoHandleRights') |
26 | 26 |
| 27 f = mojo.Func('MojoDuplicateHandleWithReducedRights', 'MojoResult') |
| 28 f.Param('handle').In('MojoHandle') |
| 29 f.Param('rights_to_remove').In('MojoHandleRights') |
| 30 f.Param('new_handle').Out('MojoHandle') |
| 31 |
| 32 f = mojo.Func('MojoDuplicateHandle', 'MojoResult') |
| 33 f.Param('handle').In('MojoHandle') |
| 34 f.Param('new_handle').Out('MojoHandle') |
| 35 |
27 f = mojo.Func('MojoWait', 'MojoResult') | 36 f = mojo.Func('MojoWait', 'MojoResult') |
28 f.Param('handle').In('MojoHandle') | 37 f.Param('handle').In('MojoHandle') |
29 f.Param('signals').In('MojoHandleSignals') | 38 f.Param('signals').In('MojoHandleSignals') |
30 f.Param('deadline').In('MojoDeadline') | 39 f.Param('deadline').In('MojoDeadline') |
31 f.Param('signals_state').OutFixedStruct('MojoHandleSignalsState').Optional() | 40 f.Param('signals_state').OutFixedStruct('MojoHandleSignalsState').Optional() |
32 | 41 |
33 f = mojo.Func('MojoWaitMany', 'MojoResult') | 42 f = mojo.Func('MojoWaitMany', 'MojoResult') |
34 f.Param('handles').InArray('MojoHandle', 'num_handles') | 43 f.Param('handles').InArray('MojoHandle', 'num_handles') |
35 f.Param('signals').InArray('MojoHandleSignals', 'num_handles') | 44 f.Param('signals').InArray('MojoHandleSignals', 'num_handles') |
36 f.Param('num_handles').In('uint32_t') | 45 f.Param('num_handles').In('uint32_t') |
(...skipping 120 matching lines...) Loading... |
157 | 166 |
158 f = mojo.Func('MojoUnmapBuffer', 'MojoResult') | 167 f = mojo.Func('MojoUnmapBuffer', 'MojoResult') |
159 f.Param('buffer').In('void*') | 168 f.Param('buffer').In('void*') |
160 # TODO(ncbray): support mmaping. | 169 # TODO(ncbray): support mmaping. |
161 # https://code.google.com/p/chromium/issues/detail?id=401761 | 170 # https://code.google.com/p/chromium/issues/detail?id=401761 |
162 f.IsBrokenInNaCl() | 171 f.IsBrokenInNaCl() |
163 | 172 |
164 mojo.Finalize() | 173 mojo.Finalize() |
165 | 174 |
166 return mojo | 175 return mojo |
OLD | NEW |