OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart.async; | 5 part of dart.async; |
6 | 6 |
7 typedef R ZoneCallback<R>(); | 7 typedef R ZoneCallback<R>(); |
8 typedef R ZoneUnaryCallback<R, T>(T arg); | 8 typedef R ZoneUnaryCallback<R, T>(T arg); |
9 typedef R ZoneBinaryCallback<R, T1, T2>(T1 arg1, T2 arg2); | 9 typedef R ZoneBinaryCallback<R, T1, T2>(T1 arg1, T2 arg2); |
10 | 10 |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 | 1374 |
1375 R runBinary<R, T1, T2>(R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) { | 1375 R runBinary<R, T1, T2>(R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) { |
1376 if (identical(Zone._current, _ROOT_ZONE)) return f(arg1, arg2); | 1376 if (identical(Zone._current, _ROOT_ZONE)) return f(arg1, arg2); |
1377 return _rootRunBinary(null, null, this, f, arg1, arg2); | 1377 return _rootRunBinary(null, null, this, f, arg1, arg2); |
1378 } | 1378 } |
1379 | 1379 |
1380 ZoneCallback<R> registerCallback<R>(R f()) => f; | 1380 ZoneCallback<R> registerCallback<R>(R f()) => f; |
1381 | 1381 |
1382 ZoneUnaryCallback<R, T> registerUnaryCallback<R, T>(R f(T arg)) => f; | 1382 ZoneUnaryCallback<R, T> registerUnaryCallback<R, T>(R f(T arg)) => f; |
1383 | 1383 |
1384 ZoneBinaryCallback<R, T1, T2> | 1384 ZoneBinaryCallback<R, T1, T2> registerBinaryCallback<R, T1, T2>( |
1385 registerBinaryCallback<R, T1, T2>(R f(T1 arg1, T2 arg2)) => f; | 1385 R f(T1 arg1, T2 arg2)) => |
| 1386 f; |
1386 | 1387 |
1387 AsyncError errorCallback(Object error, StackTrace stackTrace) => null; | 1388 AsyncError errorCallback(Object error, StackTrace stackTrace) => null; |
1388 | 1389 |
1389 void scheduleMicrotask(void f()) { | 1390 void scheduleMicrotask(void f()) { |
1390 _rootScheduleMicrotask(null, null, this, f); | 1391 _rootScheduleMicrotask(null, null, this, f); |
1391 } | 1392 } |
1392 | 1393 |
1393 Timer createTimer(Duration duration, void f()) { | 1394 Timer createTimer(Duration duration, void f()) { |
1394 return Timer._createTimer(duration, f); | 1395 return Timer._createTimer(duration, f); |
1395 } | 1396 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 handleUncaughtError: errorHandler); | 1459 handleUncaughtError: errorHandler); |
1459 } | 1460 } |
1460 Zone zone = Zone.current | 1461 Zone zone = Zone.current |
1461 .fork(specification: zoneSpecification, zoneValues: zoneValues); | 1462 .fork(specification: zoneSpecification, zoneValues: zoneValues); |
1462 if (onError != null) { | 1463 if (onError != null) { |
1463 return zone.runGuarded(body); | 1464 return zone.runGuarded(body); |
1464 } else { | 1465 } else { |
1465 return zone.run(body); | 1466 return zone.run(body); |
1466 } | 1467 } |
1467 } | 1468 } |
OLD | NEW |