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

Unified 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, 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/go/tests/system_test.go ('k') | mojo/public/go/system/impl/core_impl.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/go/system/core.go
diff --git a/mojo/public/go/system/core.go b/mojo/public/go/system/core.go
index 8f34a1c97590a7392e71265c080439d2adf6ceee..cf6ae99a4b54c1058d88d8e22a0402a7fdf459ef 100644
--- a/mojo/public/go/system/core.go
+++ b/mojo/public/go/system/core.go
@@ -5,6 +5,8 @@
package system
import (
+ "unsafe"
+
t "mojo/public/go/system/impl"
)
@@ -58,4 +60,20 @@ type Core interface {
// ReadData reads data from the data pipe consumer handle with the
// given flags. On success, returns the data that was read.
ReadData(consumer t.MojoHandle, flags t.MojoReadDataFlags) (result t.MojoResult, data []byte)
+
+ // CreateSharedBuffer creates a buffer of size numBytes that can be
+ // shared between applications. One must call MapBuffer to access
+ // the buffer.
+ CreateSharedBuffer(opts *t.SharedBufferOptions, numBytes uint64) (result t.MojoResult, handle t.MojoHandle)
+
+ // DuplicateBufferHandle duplicates the handle to a buffer.
+ DuplicateBufferHandle(handle t.MojoHandle, opts *t.DuplicateBufferHandleOptions) (result t.MojoResult, duplicate t.MojoHandle)
+
+ // MapBuffer maps the requested part of the shared buffer given by
+ // handle into memory with specified flags. On success, it returns
+ // a pointer to the requested shared buffer.
+ MapBuffer(handle t.MojoHandle, offset uint64, numBytes uint64, flags t.MojoMapBufferFlags) (result t.MojoResult, buffer unsafe.Pointer)
+
+ // UnmapBuffer unmaps a buffer pointer that was returned by MapBuffer.
+ UnmapBuffer(buffer unsafe.Pointer) (result t.MojoResult)
}
« 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