OLD | NEW |
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 part of core; | 5 part of core; |
6 | 6 |
7 class _MojoHandleNatives { | 7 class _MojoHandleNatives { |
8 static int register(MojoEventStream eventStream) native "MojoHandle_Register"; | 8 external static int register(MojoEventStream eventStream); |
9 static int close(int handle) native "MojoHandle_Close"; | 9 external static int close(int handle); |
10 static List wait(int handle, int signals, int deadline) native | 10 external static List wait(int handle, int signals, int deadline); |
11 "MojoHandle_Wait"; | 11 external static List waitMany(List<int> handles, List<int> signals, |
12 static List waitMany(List<int> handles, List<int> signals, | 12 int deadline); |
13 int deadline) native "MojoHandle_WaitMany"; | |
14 } | 13 } |
15 | 14 |
16 | 15 |
17 class MojoHandle { | 16 class MojoHandle { |
18 static const int INVALID = 0; | 17 static const int INVALID = 0; |
19 static const int DEADLINE_INDEFINITE = -1; | 18 static const int DEADLINE_INDEFINITE = -1; |
20 | 19 |
21 int h; | 20 int h; |
22 | 21 |
23 MojoHandle(this.h); | 22 MojoHandle(this.h); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 65 } |
67 | 66 |
68 bool get isValid => (h != INVALID); | 67 bool get isValid => (h != INVALID); |
69 | 68 |
70 String toString() => "$h"; | 69 String toString() => "$h"; |
71 | 70 |
72 bool operator ==(MojoHandle other) { | 71 bool operator ==(MojoHandle other) { |
73 return h == other.h; | 72 return h == other.h; |
74 } | 73 } |
75 } | 74 } |
OLD | NEW |