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

Side by Side Diff: mojo/public/dart/src/types.dart

Issue 834283003: Update Dart bindings to support updated MojoWait and MojoWaitMany APIs. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Code review revisions Created 5 years, 11 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 unified diff | Download patch
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 5
6 part of core; 6 part of core;
7 7
8 8
9 class MojoResult { 9 class MojoResult {
10 static const int kOk = 0; 10 static const int kOk = 0;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 static const int WRITABLE = 1 << 1; 124 static const int WRITABLE = 1 << 1;
125 static const int PEER_CLOSED = 1 << 2; 125 static const int PEER_CLOSED = 1 << 2;
126 static const int READWRITE = READABLE | WRITABLE; 126 static const int READWRITE = READABLE | WRITABLE;
127 127
128 static bool isNone(int mask) => mask == NONE; 128 static bool isNone(int mask) => mask == NONE;
129 static bool isReadable(int mask) => (mask & READABLE) == READABLE; 129 static bool isReadable(int mask) => (mask & READABLE) == READABLE;
130 static bool isWritable(int mask) => (mask & WRITABLE) == WRITABLE; 130 static bool isWritable(int mask) => (mask & WRITABLE) == WRITABLE;
131 static bool isReadWrite(int mask) => (mask & READWRITE) == READWRITE; 131 static bool isReadWrite(int mask) => (mask & READWRITE) == READWRITE;
132 static int toggleWrite(int mask) => 132 static int toggleWrite(int mask) =>
133 isWritable(mask) ? (mask & ~WRITABLE) : (mask | WRITABLE); 133 isWritable(mask) ? (mask & ~WRITABLE) : (mask | WRITABLE);
134 static bool isPeerClosed(int mask) => (mask & PEER_CLOSED) == PEER_CLOSED;
134 } 135 }
135 136
136 137
137 class MojoHandleSignalsState { 138 class MojoHandleSignalsState {
138 const MojoHandleSignalsState(this.satisfied_signals, 139 MojoHandleSignalsState(this.satisfied_signals,
139 this.satisfiable_signals); 140 this.satisfiable_signals);
141
140 final int satisfied_signals; 142 final int satisfied_signals;
141 final int satisfiable_signals; 143 final int satisfiable_signals;
142 } 144 }
145
146 class MojoWaitResult {
147 MojoWaitResult(this.result, this.state);
148 final MojoResult result;
149 MojoHandleSignalsState state;
150 }
151
152 class MojoWaitManyResult {
153 MojoWaitManyResult(this.result, this.index, this.states);
154 final MojoResult result;
155 final int index;
156 List<MojoHandleSignalsState> states;
157
158 bool get isIndexValid => (this.index != null);
159 bool get areSignalStatesValid => (this.states != null);
160 }
OLDNEW
« mojo/public/dart/src/handle_watcher.dart ('K') | « mojo/public/dart/src/timer_queue.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698