| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |