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

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

Issue 18325006: Add isActive field on Timer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments. Created 7 years, 5 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 | « sdk/lib/_internal/lib/isolate_helper.dart ('k') | sdk/lib/async/zone.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) 2012, the Dart project authors. Please see the AUTHORS file 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 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 abstract class Timer { 7 abstract class Timer {
8 8
9 /** 9 /**
10 * Creates a new timer. 10 * Creates a new timer.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 * This function is equivalent to `new Timer(Duration.ZERO, callback)`. 50 * This function is equivalent to `new Timer(Duration.ZERO, callback)`.
51 */ 51 */
52 static void run(void callback()) { 52 static void run(void callback()) {
53 new Timer(Duration.ZERO, callback); 53 new Timer(Duration.ZERO, callback);
54 } 54 }
55 55
56 /** 56 /**
57 * Cancels the timer. 57 * Cancels the timer.
58 */ 58 */
59 void cancel(); 59 void cancel();
60
61 /**
62 * Returns whether the timer is still active.
63 *
64 * A non-periodic timer is active if the callback has not been executed,
65 * and the timer has not been canceled.
66 *
67 * A periodic timer is active if it has not been canceled.
68 */
69 bool get isActive;
60 } 70 }
61 71
62 external Timer _createTimer(Duration duration, void callback()); 72 external Timer _createTimer(Duration duration, void callback());
63 external Timer _createPeriodicTimer(Duration duration, 73 external Timer _createPeriodicTimer(Duration duration,
64 void callback(Timer timer)); 74 void callback(Timer timer));
OLDNEW
« no previous file with comments | « sdk/lib/_internal/lib/isolate_helper.dart ('k') | sdk/lib/async/zone.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698