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

Side by Side Diff: runtime/bin/list_stream_impl.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/http_impl.dart ('k') | runtime/bin/process_impl.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 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Default implementation of [ListInputStream]. 6 * Default implementation of [ListInputStream].
7 */ 7 */
8 class _ListInputStream extends _BaseDataInputStream implements ListInputStream { 8 class _ListInputStream extends _BaseDataInputStream implements ListInputStream {
9 _ListInputStream() : _bufferList = new _BufferList(); 9 _ListInputStream() : _bufferList = new _BufferList();
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 // Schedule no pending callback if there is a callback set as this 103 // Schedule no pending callback if there is a callback set as this
104 // output stream does not wait for any transmission. Schedule 104 // output stream does not wait for any transmission. Schedule
105 // close callback once when the stream is closed. Only schedule a 105 // close callback once when the stream is closed. Only schedule a
106 // new callback if the previous one has actually been called. 106 // new callback if the previous one has actually been called.
107 if (!_closeCallbackCalled) { 107 if (!_closeCallbackCalled) {
108 if (!_streamMarkedClosed) { 108 if (!_streamMarkedClosed) {
109 if (_clientNoPendingWriteHandler != null && 109 if (_clientNoPendingWriteHandler != null &&
110 _scheduledNoPendingWriteCallback == null) { 110 _scheduledNoPendingWriteCallback == null) {
111 _scheduledNoPendingWriteCallback = 111 _scheduledNoPendingWriteCallback =
112 new Timer(issueNoPendingWriteCallback, 0); 112 new Timer(0, issueNoPendingWriteCallback);
113 } 113 }
114 } else if (_clientCloseHandler != null && 114 } else if (_clientCloseHandler != null &&
115 _streamMarkedClosed && 115 _streamMarkedClosed &&
116 !_closeCallbackCalled) { 116 !_closeCallbackCalled) {
117 _scheduledCloseCallback = new Timer(issueCloseCallback, 0); 117 _scheduledCloseCallback = new Timer(0, issueCloseCallback);
118 _closeCallbackCalled = true; 118 _closeCallbackCalled = true;
119 } 119 }
120 } 120 }
121 } 121 }
122 122
123 _BufferList _bufferList; 123 _BufferList _bufferList;
124 bool _streamMarkedClosed = false; 124 bool _streamMarkedClosed = false;
125 bool _closeCallbackCalled = false; 125 bool _closeCallbackCalled = false;
126 Timer _scheduledNoPendingWriteCallback; 126 Timer _scheduledNoPendingWriteCallback;
127 Timer _scheduledCloseCallback; 127 Timer _scheduledCloseCallback;
128 Function _clientNoPendingWriteHandler; 128 Function _clientNoPendingWriteHandler;
129 Function _clientCloseHandler; 129 Function _clientCloseHandler;
130 } 130 }
OLDNEW
« no previous file with comments | « runtime/bin/http_impl.dart ('k') | runtime/bin/process_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698