aa34e70d50
This reverts commit fc2c46ae82.
Reason for revert: broke Flutter tests:
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8724303399273084113/+/u/Run_framework_coverage_tests/stdout
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8724303399273084097/+/u/Run_framework_tests_libraries_tests/stdout
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8724303399273084081/+/u/Run_framework_tests_misc_tests/stdout
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8724303399273084049/+/u/Run_framework_tests_widgets_tests/stdout
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8724303399273084033/+/u/Run_tool_tests_tests/stdout
Original change's description:
> Make Zone functions not call `register*`, but properly catch errors.
>
> Make `Zone.createTimer`, `Zone.createPeriodicTimer` and `Zone.scheduleMicrotask`
> not call register on the same zone.
> These are low-level functions that should not build on top
> of other low-level functions.
>
> Instead the function is registered in the `Timer` constructors and
> top-level `scheduleMicrotask` code, and the root zone's `createTimer`
> and `scheduleMicrotask` just make sure that the callback will run
> in its original zone, and that uncaught errors are handled in the
> correct zone.
> Avoids a double-registration that timers did.
>
> Significant clean-up.
> - The private `_Zone`, `_ZoneSpecification` and `_ZoneDelegate`
> subclasses are not necessary now that their superclasses are `final`.
> - Stopped using type aliases instead of function types
> and old-style function arguments.
> - Renamed some parameters to not be, fx, `f`.
>
> Avoided some closure allocations for microtasks by putting the zone
> into the queue entry, instead of wrapping the callback in a closure calling `zone.run`.
>
> This is a potentially visible change if any code uses the zone functions
> directly and expect them to invoke `Zone.register*`.
> (Suspiciously no test failed with this change. May need to add some.)
>
> Fixes #59913.
>
> CoreLibraryReviewExempt: Have had all +1s, just not at the same time.
> Bug: https://dartbug.com/59913
> Change-Id: Ie3c87f5f22aedcbe30ab04718df98e1c0f0659c3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405020
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
Bug: https://dartbug.com/59913
Change-Id: I386b2b6d2594a50a7597363e13fe24111ea72ade
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406685
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>