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

Unified Diff: sdk/lib/io/http_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/file_impl.dart ('k') | sdk/lib/io/http_session.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index efa341c3d305ba48c50372cc1835fb6930b7c868..224c1e72b629b2637a08323e0e72e5b0d67affb0 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -502,7 +502,7 @@ class _HttpResponse extends _HttpRequestResponseBase implements HttpResponse {
// Indicate to the connection that the response handling is done.
_httpConnection._responseClosed();
if (_streamClosedHandler != null) {
- new Timer(0, (_) => _streamClosedHandler());
+ Timer.run(_streamClosedHandler);
}
}
@@ -1213,7 +1213,7 @@ class _HttpClientRequest
_writeDone();
_connection._requestClosed();
if (_streamClosedHandler != null) {
- new Timer(0, (_) => _streamClosedHandler());
+ Timer.run(_streamClosedHandler);
}
}
@@ -2056,7 +2056,7 @@ class _HttpClient implements HttpClient {
_SocketConnection socketConn = socketConnections.removeFirst();
socketConn._markRetrieved();
_activeSockets.add(socketConn);
- new Timer(0, (ignored) =>
+ Timer.run(() =>
_connectionOpened(socketConn, connection, !proxy.isDirect));
// Get rid of eviction timer if there are no more active connections.
@@ -2151,7 +2151,8 @@ class _HttpClient implements HttpClient {
// If all connections where evicted cancel the eviction timer.
if (_openSockets.isEmpty) _cancelEvictionTimer();
}
- _evictionTimer = new Timer.repeating(10000, _handleEviction);
+ _evictionTimer = new Timer.repeating(const Duration(seconds: 10),
+ _handleEviction);
}
// Return connection.
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | sdk/lib/io/http_session.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698