| 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 f = mojo.Func('MojoCreateSharedBuffer', 'MojoResult') | 12 f = mojo.Func('MojoCreateSharedBuffer', 'MojoResult') |
| 13 f.Param('options').InStruct('MojoCreateSharedBufferOptions').Optional() | 13 p = f.Param('options') |
| 14 p.InExtensibleStruct('MojoCreateSharedBufferOptions').Optional() |
| 14 f.Param('num_bytes').In('uint64_t') | 15 f.Param('num_bytes').In('uint64_t') |
| 15 f.Param('shared_buffer_handle').Out('MojoHandle') | 16 f.Param('shared_buffer_handle').Out('MojoHandle') |
| 16 | 17 |
| 17 f = mojo.Func('MojoDuplicateBufferHandle', 'MojoResult') | 18 f = mojo.Func('MojoDuplicateBufferHandle', 'MojoResult') |
| 18 f.Param('buffer_handle').In('MojoHandle') | 19 f.Param('buffer_handle').In('MojoHandle') |
| 19 f.Param('options').InStruct('MojoDuplicateBufferHandleOptions').Optional() | 20 p = f.Param('options') |
| 21 p.InExtensibleStruct('MojoDuplicateBufferHandleOptions').Optional() |
| 20 f.Param('new_buffer_handle').Out('MojoHandle') | 22 f.Param('new_buffer_handle').Out('MojoHandle') |
| 21 | 23 |
| 22 f = mojo.Func('MojoMapBuffer', 'MojoResult') | 24 f = mojo.Func('MojoMapBuffer', 'MojoResult') |
| 23 f.Param('buffer_handle').In('MojoHandle') | 25 f.Param('buffer_handle').In('MojoHandle') |
| 24 f.Param('offset').In('uint64_t') | 26 f.Param('offset').In('uint64_t') |
| 25 f.Param('num_bytes').In('uint64_t') | 27 f.Param('num_bytes').In('uint64_t') |
| 26 f.Param('buffer').Out('void*') | 28 f.Param('buffer').Out('void*') |
| 27 f.Param('flags').In('MojoMapBufferFlags') | 29 f.Param('flags').In('MojoMapBufferFlags') |
| 28 | 30 |
| 29 f = mojo.Func('MojoUnmapBuffer', 'MojoResult') | 31 f = mojo.Func('MojoUnmapBuffer', 'MojoResult') |
| 30 f.Param('buffer').In('void*') | 32 f.Param('buffer').In('void*') |
| 31 | 33 |
| 32 f = mojo.Func('MojoCreateDataPipe', 'MojoResult') | 34 f = mojo.Func('MojoCreateDataPipe', 'MojoResult') |
| 33 f.Param('options').InStruct('MojoCreateDataPipeOptions').Optional() | 35 p = f.Param('options') |
| 36 p.InExtensibleStruct('MojoCreateDataPipeOptions').Optional() |
| 34 f.Param('data_pipe_producer_handle').Out('MojoHandle') | 37 f.Param('data_pipe_producer_handle').Out('MojoHandle') |
| 35 f.Param('data_pipe_consumer_handle').Out('MojoHandle') | 38 f.Param('data_pipe_consumer_handle').Out('MojoHandle') |
| 36 | 39 |
| 37 f = mojo.Func('MojoWriteData', 'MojoResult') | 40 f = mojo.Func('MojoWriteData', 'MojoResult') |
| 38 f.Param('data_pipe_producer_handle').In('MojoHandle') | 41 f.Param('data_pipe_producer_handle').In('MojoHandle') |
| 39 f.Param('elements').InArray('void', 'num_bytes') | 42 f.Param('elements').InArray('void', 'num_bytes') |
| 40 f.Param('num_bytes').InOut('uint32_t') | 43 f.Param('num_bytes').InOut('uint32_t') |
| 41 f.Param('flags').In('MojoWriteDataFlags') | 44 f.Param('flags').In('MojoWriteDataFlags') |
| 42 | 45 |
| 43 f = mojo.Func('MojoBeginWriteData', 'MojoResult') | 46 f = mojo.Func('MojoBeginWriteData', 'MojoResult') |
| (...skipping 24 matching lines...) Expand all Loading... |
| 68 | 71 |
| 69 f = mojo.Func('MojoGetTimeTicksNow', 'MojoTimeTicks') | 72 f = mojo.Func('MojoGetTimeTicksNow', 'MojoTimeTicks') |
| 70 | 73 |
| 71 f = mojo.Func('MojoClose', 'MojoResult') | 74 f = mojo.Func('MojoClose', 'MojoResult') |
| 72 f.Param('handle').In('MojoHandle') | 75 f.Param('handle').In('MojoHandle') |
| 73 | 76 |
| 74 f = mojo.Func('MojoWait', 'MojoResult') | 77 f = mojo.Func('MojoWait', 'MojoResult') |
| 75 f.Param('handle').In('MojoHandle') | 78 f.Param('handle').In('MojoHandle') |
| 76 f.Param('signals').In('MojoHandleSignals') | 79 f.Param('signals').In('MojoHandleSignals') |
| 77 f.Param('deadline').In('MojoDeadline') | 80 f.Param('deadline').In('MojoDeadline') |
| 81 f.Param('signals_state').OutFixedStruct('MojoHandleSignalsState').Optional() |
| 78 | 82 |
| 79 f = mojo.Func('MojoWaitMany', 'MojoResult') | 83 f = mojo.Func('MojoWaitMany', 'MojoResult') |
| 80 f.Param('handles').InArray('MojoHandle', 'num_handles') | 84 f.Param('handles').InArray('MojoHandle', 'num_handles') |
| 81 f.Param('signals').InArray('MojoHandleSignals', 'num_handles') | 85 f.Param('signals').InArray('MojoHandleSignals', 'num_handles') |
| 82 f.Param('num_handles').In('uint32_t') | 86 f.Param('num_handles').In('uint32_t') |
| 83 f.Param('deadline').In('MojoDeadline') | 87 f.Param('deadline').In('MojoDeadline') |
| 88 f.Param('result_index').Out('uint32_t').Optional() |
| 89 p = f.Param('signals_states') |
| 90 p.OutArray('MojoHandleSignalsState', 'num_handles').Optional() |
| 84 | 91 |
| 85 f = mojo.Func('MojoCreateMessagePipe', 'MojoResult') | 92 f = mojo.Func('MojoCreateMessagePipe', 'MojoResult') |
| 86 f.Param('options').InStruct('MojoCreateMessagePipeOptions').Optional() | 93 p = f.Param('options') |
| 94 p.InExtensibleStruct('MojoCreateMessagePipeOptions').Optional() |
| 87 f.Param('message_pipe_handle0').Out('MojoHandle') | 95 f.Param('message_pipe_handle0').Out('MojoHandle') |
| 88 f.Param('message_pipe_handle1').Out('MojoHandle') | 96 f.Param('message_pipe_handle1').Out('MojoHandle') |
| 89 | 97 |
| 90 f = mojo.Func('MojoWriteMessage', 'MojoResult') | 98 f = mojo.Func('MojoWriteMessage', 'MojoResult') |
| 91 f.Param('message_pipe_handle').In('MojoHandle') | 99 f.Param('message_pipe_handle').In('MojoHandle') |
| 92 f.Param('bytes').InArray('void', 'num_bytes').Optional() | 100 f.Param('bytes').InArray('void', 'num_bytes').Optional() |
| 93 f.Param('num_bytes').In('uint32_t') | 101 f.Param('num_bytes').In('uint32_t') |
| 94 f.Param('handles').InArray('MojoHandle', 'num_handles').Optional() | 102 f.Param('handles').InArray('MojoHandle', 'num_handles').Optional() |
| 95 f.Param('num_handles').In('uint32_t') | 103 f.Param('num_handles').In('uint32_t') |
| 96 f.Param('flags').In('MojoWriteMessageFlags') | 104 f.Param('flags').In('MojoWriteMessageFlags') |
| 97 | 105 |
| 98 f = mojo.Func('MojoReadMessage', 'MojoResult') | 106 f = mojo.Func('MojoReadMessage', 'MojoResult') |
| 99 f.Param('message_pipe_handle').In('MojoHandle') | 107 f.Param('message_pipe_handle').In('MojoHandle') |
| 100 f.Param('bytes').OutArray('void', 'num_bytes').Optional() | 108 f.Param('bytes').OutArray('void', 'num_bytes').Optional() |
| 101 f.Param('num_bytes').InOut('uint32_t').Optional() | 109 f.Param('num_bytes').InOut('uint32_t').Optional() |
| 102 f.Param('handles').OutArray('MojoHandle', 'num_handles').Optional() | 110 f.Param('handles').OutArray('MojoHandle', 'num_handles').Optional() |
| 103 f.Param('num_handles').InOut('uint32_t').Optional() | 111 f.Param('num_handles').InOut('uint32_t').Optional() |
| 104 f.Param('flags').In('MojoReadMessageFlags') | 112 f.Param('flags').In('MojoReadMessageFlags') |
| 105 | 113 |
| 106 mojo.Finalize() | 114 mojo.Finalize() |
| 107 | 115 |
| 108 return mojo | 116 return mojo |
| OLD | NEW |