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

Side by Side Diff: pkg/observe/lib/src/microtask.dart

Issue 48483002: Remove deprecated parts of dart:async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 7 years, 1 month 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
« no previous file with comments | « pkg/barback/lib/src/transform_node.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * *Warning*: this library is **internal**, and APIs are subject to change. 6 * *Warning*: this library is **internal**, and APIs are subject to change.
7 * 7 *
8 * Wraps a callback using [wrapMicrotask] and provides the ability to pump all 8 * Wraps a callback using [wrapMicrotask] and provides the ability to pump all
9 * observable objects and [scheduleMicrotask] calls via 9 * observable objects and [scheduleMicrotask] calls via
10 * [performMicrotaskCheckpoint]. 10 * [performMicrotaskCheckpoint].
11 */ 11 */
12 library observe.src.microtask; 12 library observe.src.microtask;
13 13
14 import 'dart:async' show Completer, runZonedExperimental; 14 import 'dart:async' show Completer, runZoned, ZoneSpecification;
15 import 'dart:collection'; 15 import 'dart:collection';
16 import 'package:observe/observe.dart' show Observable; 16 import 'package:observe/observe.dart' show Observable;
17 17
18 // TODO(jmesserly): remove "microtask" from these names and instead import 18 // TODO(jmesserly): remove "microtask" from these names and instead import
19 // the library "as microtask"? 19 // the library "as microtask"?
20 20
21 /** 21 /**
22 * This change pumps events relevant to observers and data-binding tests. 22 * This change pumps events relevant to observers and data-binding tests.
23 * This must be used inside an [observeTest]. 23 * This must be used inside an [observeTest].
24 * 24 *
(...skipping 29 matching lines...) Expand all
54 * Wraps the [body] in a zone that supports [performMicrotaskCheckpoint], 54 * Wraps the [body] in a zone that supports [performMicrotaskCheckpoint],
55 * and returns the body. 55 * and returns the body.
56 */ 56 */
57 // TODO(jmesserly): deprecate? this doesn't add much over runMicrotask. 57 // TODO(jmesserly): deprecate? this doesn't add much over runMicrotask.
58 wrapMicrotask(body()) => () => runMicrotask(body); 58 wrapMicrotask(body()) => () => runMicrotask(body);
59 59
60 /** 60 /**
61 * Runs the [body] in a zone that supports [performMicrotaskCheckpoint], 61 * Runs the [body] in a zone that supports [performMicrotaskCheckpoint],
62 * and returns the result. 62 * and returns the result.
63 */ 63 */
64 runMicrotask(body()) => runZonedExperimental(() { 64 runMicrotask(body()) => runZoned(() {
65 try { 65 try {
66 return body(); 66 return body();
67 } finally { 67 } finally {
68 performMicrotaskCheckpoint(); 68 performMicrotaskCheckpoint();
69 } 69 }
70 }, onRunAsync: (callback) => _pending.add(callback)); 70 }, zoneSpecification: new ZoneSpecification(
71 scheduleMicrotask: (self, parent, zone, callback) => _pending.add(callback))
72 );
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/transform_node.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698