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

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

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « runtime/lib/string_patch.dart ('k') | runtime/tests/vm/dart/isolate_mirror_local_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
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 patch class Timer {
6 /* patch */ factory Timer(int milliseconds, void callback(Timer timer)) {
7 if (_TimerFactory._factory == null) {
8 throw new UnsupportedError("Timer interface not supported.");
9 }
10 return _TimerFactory._factory(milliseconds, callback, false);
11 }
12
13 /**
14 * Creates a new repeating timer. The [callback] is invoked every
15 * [milliseconds] millisecond until cancelled.
16 */
17 /* patch */ factory Timer.repeating(int milliseconds,
18 void callback(Timer timer)) {
19 if (_TimerFactory._factory == null) {
20 throw new UnsupportedError("Timer interface not supported.");
21 }
22 return _TimerFactory._factory(milliseconds, callback, true);
23 }
24 }
25
26 typedef Timer _TimerFactoryClosure(int milliseconds,
27 void callback(Timer timer),
28 bool repeating);
29
30 class _TimerFactory {
31 static _TimerFactoryClosure _factory;
32 }
33
34 // TODO(ahe): Warning: this is NOT called by Dartium. Instead, it sets
35 // [_TimerFactory._factory] directly.
36 void _setTimerFactoryClosure(_TimerFactoryClosure closure) {
37 _TimerFactory._factory = closure;
38 }
OLDNEW
« no previous file with comments | « runtime/lib/string_patch.dart ('k') | runtime/tests/vm/dart/isolate_mirror_local_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698