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

Unified Diff: mojo/public/go/system/impl/mojo_types.go

Issue 795593004: Update mojo sdk to rev cc531b32182099a5a034a99daff35ed5d38a61c8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More workarounds for MSVC Created 6 years 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') | mojo/public/interfaces/bindings/tests/test_structs.mojom » ('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 bd82898db087d8b815e2893049597a088da585d7..0218a335deaed8824be1a7296dd0ee01d562710d 100644
--- a/mojo/public/go/system/impl/mojo_types.go
+++ b/mojo/public/go/system/impl/mojo_types.go
@@ -54,10 +54,10 @@ const (
MOJO_RESULT_BUSY = -16
MOJO_RESULT_SHOULD_WAIT = -17
- MOJO_HANDLE_SIGNAL_NONE MojoHandleSignals = 0
- MOJO_HANDLE_SIGNAL_READABLE = 1 << 0
- MOJO_HANDLE_SIGNAL_WRITABLE = 1 << 1
- MOJO_HANDLE_SIGNAL_PEER_CLOSED = 1 << 2
+ MOJO_HANDLE_SIGNAL_NONE MojoHandleSignals = 0
+ MOJO_HANDLE_SIGNAL_READABLE = 1 << 0
+ MOJO_HANDLE_SIGNAL_WRITABLE = 1 << 1
+ MOJO_HANDLE_SIGNAL_PEER_CLOSED = 1 << 2
MOJO_WRITE_MESSAGE_FLAG_NONE MojoWriteMessageFlags = 0
MOJO_READ_MESSAGE_FLAG_NONE MojoReadMessageFlags = 0
@@ -90,6 +90,18 @@ type DataPipeOptions struct {
capacity uint32
}
+type MojoHandleSignalsState struct {
+ SatisfiedSignals MojoHandleSignals
+ SatisfiableSignals MojoHandleSignals
+}
+
+func NewMojoHandleSignalsState(cstate C.struct_MojoHandleSignalsState) MojoHandleSignalsState {
+ return MojoHandleSignalsState{
+ MojoHandleSignals(cstate.satisfied_signals),
+ MojoHandleSignals(cstate.satisfiable_signals),
+ }
+}
+
func (opts *DataPipeOptions) cType() *C.struct_MojoCreateDataPipeOptions {
if opts == nil {
return nil
@@ -157,6 +169,16 @@ func (opts *DuplicateBufferHandleOptions) cType() *C.struct_MojoDuplicateBufferH
return &cOpts
}
+func (m MojoHandleSignals) IsReadable() bool {
+ return (m & MOJO_HANDLE_SIGNAL_READABLE) != 0
+}
+func (m MojoHandleSignals) IsWritable() bool {
+ return (m & MOJO_HANDLE_SIGNAL_WRITABLE) != 0
+}
+func (m MojoHandleSignals) IsClosed() bool {
+ return (m & MOJO_HANDLE_SIGNAL_PEER_CLOSED) != 0
+}
+
// Convenience functions to convert Go types to their equivalent C types.
func (m MojoHandle) cType() C.MojoHandle {
return (C.MojoHandle)(m)
@@ -167,6 +189,9 @@ func (m MojoDeadline) cType() C.MojoDeadline {
func (m MojoHandleSignals) cType() C.MojoHandleSignals {
return (C.MojoHandleSignals)(m)
}
+func (m MojoHandleSignalsState) cType() C.struct_MojoHandleSignalsState {
+ return C.struct_MojoHandleSignalsState{m.SatisfiedSignals.cType(), m.SatisfiableSignals.cType()}
+}
func (m MojoWriteMessageFlags) cType() C.MojoWriteMessageFlags {
return (C.MojoWriteMessageFlags)(m)
}
@@ -194,6 +219,7 @@ func (m MojoDuplicateBufferHandleOptionsFlags) cType() C.MojoDuplicateBufferHand
func (m MojoMapBufferFlags) cType() C.MojoMapBufferFlags {
return (C.MojoMapBufferFlags)(m)
}
+
func cArrayMojoHandle(m []MojoHandle) *C.MojoHandle {
if len(m) == 0 {
return nil
@@ -206,6 +232,7 @@ func cArrayMojoHandleSignals(m []MojoHandleSignals) *C.MojoHandleSignals {
}
return (*C.MojoHandleSignals)(&m[0])
}
+
func cArrayBytes(m []byte) unsafe.Pointer {
if len(m) == 0 {
return nil
« no previous file with comments | « mojo/public/go/system/impl/core_impl.go ('k') | mojo/public/interfaces/bindings/tests/test_structs.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698