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

Side by Side Diff: mojo/public/go/system/core.go

Issue 664163004: -Go bindings for creating/managing shared buffers between applications (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Go build patches Created 6 years, 1 month 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
« no previous file with comments | « mojo/go/tests/system_test.go ('k') | mojo/public/go/system/impl/core_impl.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 package system 5 package system
6 6
7 import ( 7 import (
8 "unsafe"
9
8 t "mojo/public/go/system/impl" 10 t "mojo/public/go/system/impl"
9 ) 11 )
10 12
11 // Core is an interface that defines the set of Mojo system APIs. 13 // Core is an interface that defines the set of Mojo system APIs.
12 type Core interface { 14 type Core interface {
13 // GetTimeTicksNow returns a monotonically increasing platform 15 // GetTimeTicksNow returns a monotonically increasing platform
14 // dependent tick count representing "right now". Resolution 16 // dependent tick count representing "right now". Resolution
15 // depends on the systemconfiguration. 17 // depends on the systemconfiguration.
16 GetTimeTicksNow() t.MojoTimeTicks 18 GetTimeTicksNow() t.MojoTimeTicks
17 19
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 CreateDataPipe(opts *t.DataPipeOptions) (result t.MojoResult, producer t .MojoHandle, consumer t.MojoHandle) 53 CreateDataPipe(opts *t.DataPipeOptions) (result t.MojoResult, producer t .MojoHandle, consumer t.MojoHandle)
52 54
53 // WriteData writes data to the data pipe producer handle with the 55 // WriteData writes data to the data pipe producer handle with the
54 // given flags. On success, returns the number of bytes that were 56 // given flags. On success, returns the number of bytes that were
55 // actually written. 57 // actually written.
56 WriteData(producer t.MojoHandle, data []byte, flags t.MojoWriteDataFlags ) (result t.MojoResult, numBytes uint32) 58 WriteData(producer t.MojoHandle, data []byte, flags t.MojoWriteDataFlags ) (result t.MojoResult, numBytes uint32)
57 59
58 // ReadData reads data from the data pipe consumer handle with the 60 // ReadData reads data from the data pipe consumer handle with the
59 // given flags. On success, returns the data that was read. 61 // given flags. On success, returns the data that was read.
60 ReadData(consumer t.MojoHandle, flags t.MojoReadDataFlags) (result t.Moj oResult, data []byte) 62 ReadData(consumer t.MojoHandle, flags t.MojoReadDataFlags) (result t.Moj oResult, data []byte)
63
64 // CreateSharedBuffer creates a buffer of size numBytes that can be
65 // shared between applications. One must call MapBuffer to access
66 // the buffer.
67 CreateSharedBuffer(opts *t.SharedBufferOptions, numBytes uint64) (result t.MojoResult, handle t.MojoHandle)
68
69 // DuplicateBufferHandle duplicates the handle to a buffer.
70 DuplicateBufferHandle(handle t.MojoHandle, opts *t.DuplicateBufferHandle Options) (result t.MojoResult, duplicate t.MojoHandle)
71
72 // MapBuffer maps the requested part of the shared buffer given by
73 // handle into memory with specified flags. On success, it returns
74 // a pointer to the requested shared buffer.
75 MapBuffer(handle t.MojoHandle, offset uint64, numBytes uint64, flags t.M ojoMapBufferFlags) (result t.MojoResult, buffer unsafe.Pointer)
76
77 // UnmapBuffer unmaps a buffer pointer that was returned by MapBuffer.
78 UnmapBuffer(buffer unsafe.Pointer) (result t.MojoResult)
61 } 79 }
OLDNEW
« no previous file with comments | « mojo/go/tests/system_test.go ('k') | mojo/public/go/system/impl/core_impl.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698