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

Side by Side Diff: samples/actors/core/actors-term.dart

Issue 9597015: Update Timer API to take the callback as the last parameter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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/bin/timer_impl.dart ('k') | samples/chat/chat_server.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 #library('actors'); 1 #library('actors');
2 #source('actors.dart'); 2 #source('actors.dart');
3 #source('actors-interface.dart'); 3 #source('actors-interface.dart');
4 #source('actors-ui.dart'); 4 #source('actors-ui.dart');
5 5
6 class _WindowActor extends Actor { 6 class _WindowActor extends Actor {
7 _WindowActor() : super() { 7 _WindowActor() : super() {
8 on["print"] = (String m) { 8 on["print"] = (String m) {
9 print("${m}"); 9 print("${m}");
10 }; 10 };
11 11
12 /** 12 /**
13 * Sends a message back using the 'reply' parameter after specified number 13 * Sends a message back using the 'reply' parameter after specified number
14 * of milliseconds specified by 'timeout' parameter. 14 * of milliseconds specified by 'timeout' parameter.
15 */ 15 */
16 on["setTimeout"] = (Reply reply, int timeout) { 16 on["setTimeout"] = (Reply reply, int timeout) {
17 new Timer((Timer t) {reply.respond();}, timeout); 17 new Timer(timeout, (Timer t) {reply.respond();});
18 }; 18 };
19 } 19 }
20 } 20 }
21 21
22 class _WindowProxyImpl extends _NullWindowProxy { 22 class _WindowProxyImpl extends _NullWindowProxy {
23 ActorId _window; 23 ActorId _window;
24 _WindowProxyImpl(this._window); 24 _WindowProxyImpl(this._window);
25 25
26 void print(String m) => _window.send("print", [m]); 26 void print(String m) => _window.send("print", [m]);
27 27
28 void setTimeout(Reply t, int timeout) => 28 void setTimeout(Reply t, int timeout) =>
29 _window.send("setTimeout", [t, timeout]); 29 _window.send("setTimeout", [t, timeout]);
30 } 30 }
OLDNEW
« no previous file with comments | « runtime/bin/timer_impl.dart ('k') | samples/chat/chat_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698