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

Unified Diff: sdk/lib/io/string_stream.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/stream_util.dart ('k') | sdk/lib/io/websocket_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/string_stream.dart
diff --git a/sdk/lib/io/string_stream.dart b/sdk/lib/io/string_stream.dart
index b8101f09a15728771362572a260dd5a492565c73..cd38e2cb3c14c15102c070c5ea9a7c002a8b23d7 100644
--- a/sdk/lib/io/string_stream.dart
+++ b/sdk/lib/io/string_stream.dart
@@ -525,7 +525,7 @@ class _StringInputStream implements StringInputStream {
// TODO(sgjesse): Find a better way of scheduling callbacks from
// the event loop.
void _checkScheduleCallback() {
- void issueDataCallback(Timer timer) {
+ void issueDataCallback() {
_scheduledDataCallback = null;
if (_clientDataHandler != null) {
_clientDataHandler();
@@ -533,7 +533,7 @@ class _StringInputStream implements StringInputStream {
}
}
- void issueLineCallback(Timer timer) {
+ void issueLineCallback() {
_scheduledLineCallback = null;
if (_clientLineHandler != null) {
_clientLineHandler();
@@ -541,7 +541,7 @@ class _StringInputStream implements StringInputStream {
}
}
- void issueCloseCallback(Timer timer) {
+ void issueCloseCallback() {
_scheduledCloseCallback = null;
if (!_closed) {
if (_clientCloseHandler != null) _clientCloseHandler();
@@ -557,7 +557,7 @@ class _StringInputStream implements StringInputStream {
if (_scheduledLineCallback != null) {
_scheduledLineCallback.cancel();
}
- _scheduledDataCallback = new Timer(0, issueDataCallback);
+ _scheduledDataCallback = Timer.run(issueDataCallback);
}
// Schedule line callback if a line is available.
@@ -567,14 +567,14 @@ class _StringInputStream implements StringInputStream {
if (_scheduledDataCallback != null) {
_scheduledDataCallback.cancel();
}
- _scheduledLineCallback = new Timer(0, issueLineCallback);
+ _scheduledLineCallback = Timer.run(issueLineCallback);
}
// Schedule close callback if no more data and input is closed.
if (_decoder.isEmpty &&
_inputClosed &&
_scheduledCloseCallback == null) {
- _scheduledCloseCallback = new Timer(0, issueCloseCallback);
+ _scheduledCloseCallback = Timer.run(issueCloseCallback);
}
}
}
« no previous file with comments | « sdk/lib/io/stream_util.dart ('k') | sdk/lib/io/websocket_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698