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

Side by Side Diff: runtime/bin/chunked_stream.dart

Issue 8836005: Fix running tests with --checked (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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 | « no previous file | no next file » | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class _ChunkedInputStream implements ChunkedInputStream { 5 class _ChunkedInputStream implements ChunkedInputStream {
6 _ChunkedInputStream(InputStream this._input, [int chunkSize]) 6 _ChunkedInputStream(InputStream this._input, [int chunkSize])
7 : _chunkSize = chunkSize, _bufferList = new _BufferList() { 7 : _chunkSize = chunkSize, _bufferList = new _BufferList() {
8 if (_chunkSize === null) { 8 if (_chunkSize === null) {
9 _chunkSize = 0; 9 _chunkSize = 0;
10 } 10 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 void _readData() { 59 void _readData() {
60 List<int> data = _input.read(); 60 List<int> data = _input.read();
61 if (data !== null) { 61 if (data !== null) {
62 _bufferList.add(data); 62 _bufferList.add(data);
63 } 63 }
64 } 64 }
65 65
66 void _closeHandler() { 66 void _closeHandler() {
67 _inputClosed = true; 67 _inputClosed = true;
68 if (_bufferList.length == 0 && _clientCloseHandler) { 68 if (_bufferList.length == 0 && _clientCloseHandler !== null) {
69 _clientCloseHandler(); 69 _clientCloseHandler();
70 _closed = true; 70 _closed = true;
71 } else { 71 } else {
72 _checkScheduleCallback(); 72 _checkScheduleCallback();
73 } 73 }
74 } 74 }
75 75
76 void _checkInstallDataHandler() { 76 void _checkInstallDataHandler() {
77 if (_clientDataHandler === null) { 77 if (_clientDataHandler === null) {
78 _input.dataHandler = null; 78 _input.dataHandler = null;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 117
118 InputStream _input; 118 InputStream _input;
119 _BufferList _bufferList; 119 _BufferList _bufferList;
120 int _chunkSize; 120 int _chunkSize;
121 bool _inputClosed = false; // Is the underlying input stream closed? 121 bool _inputClosed = false; // Is the underlying input stream closed?
122 bool _closed = false; // Has the close handler been called?. 122 bool _closed = false; // Has the close handler been called?.
123 var _clientDataHandler; 123 var _clientDataHandler;
124 var _clientCloseHandler; 124 var _clientCloseHandler;
125 } 125 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698