OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 package system | |
6 | |
7 // This interface wraps the "raw" mojo system entry points. This has no | |
8 // dependencies on other types in this package so it can be implemented | |
9 // by code that doesn't depend on this package. | |
10 type MojoSystem interface { | |
11 // Shared buffer | |
12 CreateSharedBuffer(flags uint32, numBytes uint64) (result uint32, handle
uint32) | |
13 DuplicateBufferHandle(handle uint32, flags uint32) (result uint32, dupHa
ndle uint32) | |
14 GetBufferInformation(handle uint32) (result uint32, flags uint32, numByt
es uint64) | |
15 // After a successful MapBuffer call, the caller must pass the same slic
e value to UnmapBuffer to release | |
16 // the underlying memory segment. | |
17 MapBuffer(handle uint32, offset, numBytes uint64, flags uint32) (result
uint32, buf []byte) | |
18 UnmapBuffer(buf []byte) (result uint32) | |
19 | |
20 // Data pipe | |
21 CreateDataPipe(flags, elementNumBytes, capacityNumBytes uint32) (result
uint32, producerHandle, consumerHandle uint32) | |
22 CreateDataPipeWithDefaultOptions() (result uint32, producerHandle, consu
merHandle uint32) | |
23 WriteData(producerHandle uint32, buf []byte, flags uint32) (result uint3
2, bytesWritten uint32) | |
24 BeginWriteData(producerHandle uint32, flags uint32) (result uint32, buf
[]byte) | |
25 EndWriteData(producerHandle uint32, numBytesWritten uint32) (result uint
32) | |
26 | |
27 ReadData(consumerHandle, flags uint32) (result uint32, buf []byte) | |
28 BeginReadData(consumerHandle uint32, flags uint32) (result uint32, buf [
]byte) | |
29 EndReadData(consumerHandle uint32, numBytesRead uint32) (result uint32) | |
30 | |
31 // Time | |
32 GetTimeTicksNow() (timestamp uint64) | |
33 | |
34 // Close a handle | |
35 Close(handle uint32) (result uint32) | |
36 | |
37 // Waiting | |
38 Wait(handle uint32, signals uint32, deadline uint64) (result uint32, sat
isfiedSignals, satisfiableSignals uint32) | |
39 WaitMany(handles []uint32, signals []uint32, deadline uint64) (result ui
nt32, index int, satisfiedSignals, satisfiableSignals []uint32) | |
40 | |
41 // Message pipe | |
42 CreateMessagePipe(flags uint32) (result uint32, handle0, handle1 uint32) | |
43 WriteMessage(handle uint32, bytes []byte, handles []uint32, flags uint32
) (result uint32) | |
44 ReadMessage(handle uint32, flags uint32) (result uint32, buf []byte, han
dles []uint32) | |
45 } | |
46 | |
47 var sysImpl MojoSystem | |
OLD | NEW |