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

Side by Side Diff: sdk/lib/async/zone.dart

Issue 891293003: Store zone in microtask entry. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
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 dynamic ZoneCallback(); 7 typedef dynamic ZoneCallback();
8 typedef dynamic ZoneUnaryCallback(arg); 8 typedef dynamic ZoneUnaryCallback(arg);
9 typedef dynamic ZoneBinaryCallback(arg1, arg2); 9 typedef dynamic ZoneBinaryCallback(arg1, arg2);
10 10
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 } 937 }
938 938
939 AsyncError _rootErrorCallback(Zone self, ZoneDelegate parent, Zone zone, 939 AsyncError _rootErrorCallback(Zone self, ZoneDelegate parent, Zone zone,
940 Object error, StackTrace stackTrace) => null; 940 Object error, StackTrace stackTrace) => null;
941 941
942 void _rootScheduleMicrotask(Zone self, ZoneDelegate parent, Zone zone, f()) { 942 void _rootScheduleMicrotask(Zone self, ZoneDelegate parent, Zone zone, f()) {
943 if (!identical(_ROOT_ZONE, zone)) { 943 if (!identical(_ROOT_ZONE, zone)) {
944 bool hasErrorHandler = !_ROOT_ZONE.inSameErrorZone(zone); 944 bool hasErrorHandler = !_ROOT_ZONE.inSameErrorZone(zone);
945 f = zone.bindCallback(f, runGuarded: hasErrorHandler); 945 f = zone.bindCallback(f, runGuarded: hasErrorHandler);
946 } 946 }
947 _scheduleAsyncCallback(f); 947 _scheduleAsyncCallback(new _AsyncCallbackEntry(f, zone));
948 } 948 }
949 949
950 Timer _rootCreateTimer(Zone self, ZoneDelegate parent, Zone zone, 950 Timer _rootCreateTimer(Zone self, ZoneDelegate parent, Zone zone,
951 Duration duration, void callback()) { 951 Duration duration, void callback()) {
952 if (!identical(_ROOT_ZONE, zone)) { 952 if (!identical(_ROOT_ZONE, zone)) {
953 callback = zone.bindCallback(callback); 953 callback = zone.bindCallback(callback);
954 } 954 }
955 return Timer._createTimer(duration, callback); 955 return Timer._createTimer(duration, callback);
956 } 956 }
957 957
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 handleUncaughtError: errorHandler); 1244 handleUncaughtError: errorHandler);
1245 } 1245 }
1246 Zone zone = Zone.current.fork(specification: zoneSpecification, 1246 Zone zone = Zone.current.fork(specification: zoneSpecification,
1247 zoneValues: zoneValues); 1247 zoneValues: zoneValues);
1248 if (onError != null) { 1248 if (onError != null) {
1249 return zone.runGuarded(body); 1249 return zone.runGuarded(body);
1250 } else { 1250 } else {
1251 return zone.run(body); 1251 return zone.run(body);
1252 } 1252 }
1253 } 1253 }
OLDNEW
« sdk/lib/async/schedule_microtask.dart ('K') | « sdk/lib/async/schedule_microtask.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698