OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library _isolate_helper; | 5 library _isolate_helper; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection' show Queue, HashMap; | 8 import 'dart:collection' show Queue, HashMap; |
9 import 'dart:isolate'; | 9 import 'dart:isolate'; |
10 import 'dart:_js_helper' show | 10 import 'dart:_js_helper' show |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 /** | 146 /** |
147 * Whether to use web workers when implementing isolates. Set to false for | 147 * Whether to use web workers when implementing isolates. Set to false for |
148 * debugging/testing. | 148 * debugging/testing. |
149 */ | 149 */ |
150 bool get useWorkers => supportsWorkers; | 150 bool get useWorkers => supportsWorkers; |
151 | 151 |
152 /** | 152 /** |
153 * Whether to use the web-worker JSON-based message serialization protocol. By | 153 * Whether to use the web-worker JSON-based message serialization protocol. By |
154 * default this is only used with web workers. For debugging, you can force | 154 * default this is only used with web workers. For debugging, you can force |
155 * using this protocol by changing this field value to [true]. | 155 * using this protocol by changing this field value to [:true:]. |
156 */ | 156 */ |
157 bool get needSerialization => useWorkers; | 157 bool get needSerialization => useWorkers; |
158 | 158 |
159 /** | 159 /** |
160 * Registry of isolates. Isolates must be registered if, and only if, receive | 160 * Registry of isolates. Isolates must be registered if, and only if, receive |
161 * ports are alive. Normally no open receive-ports means that the isolate is | 161 * ports are alive. Normally no open receive-ports means that the isolate is |
162 * dead, but DOM callbacks could resurrect it. | 162 * dead, but DOM callbacks could resurrect it. |
163 */ | 163 */ |
164 Map<int, _IsolateContext> isolates; | 164 Map<int, _IsolateContext> isolates; |
165 | 165 |
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1312 _handle = null; | 1312 _handle = null; |
1313 } else { | 1313 } else { |
1314 throw new UnsupportedError("Canceling a timer."); | 1314 throw new UnsupportedError("Canceling a timer."); |
1315 } | 1315 } |
1316 } | 1316 } |
1317 | 1317 |
1318 bool get isActive => _handle != null; | 1318 bool get isActive => _handle != null; |
1319 } | 1319 } |
1320 | 1320 |
1321 bool hasTimer() => JS('', '#.setTimeout', globalThis) != null; | 1321 bool hasTimer() => JS('', '#.setTimeout', globalThis) != null; |
OLD | NEW |