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

Unified Diff: mojo/public/go/system/impl/mojo_types.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, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/go/system/impl/core_impl.go ('k') | third_party/libevent/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/go/system/impl/mojo_types.go
diff --git a/mojo/public/go/system/impl/mojo_types.go b/mojo/public/go/system/impl/mojo_types.go
index 32d64bdd0434e6c2ac7e8401c236365100b1c8a0..9156a4594e5e680127324fd22204301cbb9366f9 100644
--- a/mojo/public/go/system/impl/mojo_types.go
+++ b/mojo/public/go/system/impl/mojo_types.go
@@ -28,6 +28,9 @@ type MojoWriteDataFlags uint32
type MojoReadDataFlags uint32
type MojoCreateDataPipeOptionsFlags uint32
type MojoCreateMessagePipeOptionsFlags uint32
+type MojoCreateSharedBufferOptionsFlags uint32
+type MojoDuplicateBufferHandleOptionsFlags uint32
+type MojoMapBufferFlags uint32
const (
MOJO_DEADLINE_INDEFINITE MojoDeadline = math.MaxUint64
@@ -69,6 +72,10 @@ const (
MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE MojoCreateDataPipeOptionsFlags = 0
MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_MAY_DISCARD = 1 << 0
MOJO_CREATE_MESSAGE_PIPE_OPTIONS_FLAG_NONE MojoCreateMessagePipeOptionsFlags = 0
+
+ MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE MojoCreateSharedBufferOptionsFlags = 0
+ MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_NONE MojoDuplicateBufferHandleOptionsFlags = 0
+ MOJO_MAP_BUFFER_FLAG_NONE MojoMapBufferFlags = 0
)
// DataPipeOptions is used to specify creation parameters for a data pipe.
@@ -112,6 +119,42 @@ func (opts *MessagePipeOptions) cType() *C.struct_MojoCreateMessagePipeOptions {
return &cOpts
}
+// SharedBufferOptions is used to specify creation parameters for a
+// shared buffer.
+type SharedBufferOptions struct {
+ flags MojoCreateSharedBufferOptionsFlags
+}
+
+func (opts *SharedBufferOptions) cType() *C.struct_MojoCreateSharedBufferOptions {
+ if opts == nil {
+ return nil
+ }
+ var cOpts C.struct_MojoCreateSharedBufferOptions
+ cOpts = C.struct_MojoCreateSharedBufferOptions{
+ (C.uint32_t)(unsafe.Sizeof(cOpts)),
+ opts.flags.cType(),
+ }
+ return &cOpts
+}
+
+// DuplicateBufferHandleOptions is used to specify parameters in
+// duplicating access to a shared buffer.
+type DuplicateBufferHandleOptions struct {
+ flags MojoDuplicateBufferHandleOptionsFlags
+}
+
+func (opts *DuplicateBufferHandleOptions) cType() *C.struct_MojoDuplicateBufferHandleOptions {
+ if opts == nil {
+ return nil
+ }
+ var cOpts C.struct_MojoDuplicateBufferHandleOptions
+ cOpts = C.struct_MojoDuplicateBufferHandleOptions{
+ (C.uint32_t)(unsafe.Sizeof(cOpts)),
+ opts.flags.cType(),
+ }
+ return &cOpts
+}
+
// Convenience functions to convert Go types to their equivalent C types.
func (m MojoHandle) cType() C.MojoHandle {
return (C.MojoHandle)(m)
@@ -140,6 +183,15 @@ func (m MojoCreateDataPipeOptionsFlags) cType() C.MojoCreateDataPipeOptionsFlags
func (m MojoCreateMessagePipeOptionsFlags) cType() C.MojoCreateMessagePipeOptionsFlags {
return (C.MojoCreateMessagePipeOptionsFlags)(m)
}
+func (m MojoCreateSharedBufferOptionsFlags) cType() C.MojoCreateSharedBufferOptionsFlags {
+ return (C.MojoCreateSharedBufferOptionsFlags)(m)
+}
+func (m MojoDuplicateBufferHandleOptionsFlags) cType() C.MojoDuplicateBufferHandleOptionsFlags {
+ return (C.MojoDuplicateBufferHandleOptionsFlags)(m)
+}
+func (m MojoMapBufferFlags) cType() C.MojoMapBufferFlags {
+ return (C.MojoMapBufferFlags)(m)
+}
func cArrayMojoHandle(m []MojoHandle) *C.MojoHandle {
if len(m) == 0 {
return nil
« no previous file with comments | « mojo/public/go/system/impl/core_impl.go ('k') | third_party/libevent/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698