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

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

Issue 12342014: Remove deprecated ms arguments for Timer and Future. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
Index: sdk/lib/io/secure_socket.dart
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index c1f40db91ed87817ace2ad5633e1ae8b445d4660..d9e5e23b54729ad80bf4e68d8442d2acf0de086e 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -389,7 +389,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
_controller.hasSubscribers &&
_secureFilter != null &&
_secureFilter.buffers[WRITE_PLAINTEXT].free > 0) {
- new Timer(0, (_) => _controller.add(RawSocketEvent.WRITE));
+ Timer.run(() => _controller.add(RawSocketEvent.WRITE));
} else {
_writeEventsEnabled = value;
}
@@ -402,7 +402,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
if (_socketClosedRead) {
if (value) {
// We have no underlying socket to set off read events.
- new Timer(0, (_) => _readHandler());
+ Timer.run(_readHandler);
}
}
}
@@ -432,7 +432,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
// Set up a read event if the filter still has data.
if (!_filterReadEmpty) {
- new Timer(0, (_) => _readHandler());
+ Timer.run(_readHandler);
}
if (_socketClosedRead) { // An onClose event is pending.
@@ -446,7 +446,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
if (_filterReadEmpty) {
// This can't be an else clause: the value of _filterReadEmpty changes.
// This must be asynchronous, because we are in a read call.
- new Timer(0, (_) => _closeHandler());
+ Timer.run(_closeHandler);
}
}
@@ -532,7 +532,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
}
if (_socketClosedRead) {
// Keep firing read events until we are paused or buffer is empty.
- new Timer(0, (_) => _readHandler());
+ Timer.run(_readHandler);
}
}
} else if (_socketClosedRead) {
@@ -602,7 +602,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
// If we complete the future synchronously, user code will run here,
// and modify the state of the RawSecureSocket. For example, it
// could close the socket, and set _filter to null.
- new Timer(0, (_) => _handshakeComplete.complete(this));
+ Timer.run(() => _handshakeComplete.complete(this));
}
}

Powered by Google App Engine
This is Rietveld 408576698