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

Side by Side Diff: runtime/lib/event_loop_patch.dart

Issue 26993002: Add factory-method for scheduleMicrotask, as well as a (failing) test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
« no previous file with comments | « no previous file | tests/lib/async/schedule_microtask_test.dart » ('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 patch class _AsyncRun { 5 patch class _AsyncRun {
6 /* patch */ static void _enqueueImmediate(void callback()) { 6 /* patch */ static void _enqueueImmediate(void callback()) {
7 // TODO(9001): don't use the Timer to enqueue the immediate callback. 7 if (_EnqueueImmediateFactory._factory == null) {
8 _createTimer(Duration.ZERO, callback); 8 // TODO(9001): don't default to using the Timer to enqueue the immediate
9 // callback.
10 _createTimer(Duration.ZERO, callback);
11 return;
12 }
13 _EnqueueImmediateFactory._factory(callback);
9 } 14 }
10 } 15 }
16
17 typedef void _EnqueueImmediateFactoryClosure(void callback());
18
19 class _EnqueueImmediateFactory {
floitsch 2013/10/11 09:35:37 I think factory is the wrong name. For timers it w
Anders Johnsen 2013/10/14 10:15:10 Done.
20 static _EnqueueImmediateFactoryClosure _factory;
21 }
22
23 void _setEnqueueImmediateFactoryClosure(
24 _EnqueueImmediateFactoryClosure closure) {
25 _EnqueueImmediateFactory._factory = closure;
26 }
OLDNEW
« no previous file with comments | « no previous file | tests/lib/async/schedule_microtask_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698