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

Unified Diff: sdk/lib/io/websocket_impl.dart

Issue 12213092: Rework Timer interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/string_stream.dart ('k') | tests/compiler/dart2js_extra/timer_negative_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/websocket_impl.dart
diff --git a/sdk/lib/io/websocket_impl.dart b/sdk/lib/io/websocket_impl.dart
index d7408b9ff544396b64432f636d6bf09904f6949d..673fe23331706c318e3cb655e1b863a17e9cd2ad 100644
--- a/sdk/lib/io/websocket_impl.dart
+++ b/sdk/lib/io/websocket_impl.dart
@@ -453,17 +453,13 @@ class _WebSocketConnectionBase {
if (_closeTimer != null) _closeTimer.cancel();
_socket.close();
};
- _closeTimer = new Timer(5000, (t) {
- _socket.close();
- });
+ _closeTimer = new Timer(const Duration(seconds: 5), _socket.close);
} else {
// Half close the socket and expect a close frame in response
// before closing the socket. If a close frame does not arrive
// within a reasonable amount of time just close the socket.
_socket.outputStream.close();
- _closeTimer = new Timer(5000, (t) {
- _socket.close();
- });
+ _closeTimer = new Timer(const Duration(seconds: 5), _socket.close);
}
_closeSent = true;
}
« no previous file with comments | « sdk/lib/io/string_stream.dart ('k') | tests/compiler/dart2js_extra/timer_negative_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698