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

Side by Side Diff: sdk/lib/io/io_sink.dart

Issue 12408004: Fix checked mode error on socket IOSink (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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/socket_patch.dart ('k') | tests/standalone/io/stdout_stderr_test.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * Helper class to wrap a [StreamConsumer<List<int>, T>] and provide 8 * Helper class to wrap a [StreamConsumer<List<int>, T>] and provide
9 * utility functions for writing to the StreamConsumer directly. The 9 * utility functions for writing to the StreamConsumer directly. The
10 * [IOSink] buffers the input given by [write], [writeAll], [writeln], 10 * [IOSink] buffers the input given by [write], [writeAll], [writeln],
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 Future<T> _pipeFuture; 62 Future<T> _pipeFuture;
63 StreamSubscription<List<int>> _bindSubscription; 63 StreamSubscription<List<int>> _bindSubscription;
64 bool _paused = true; 64 bool _paused = true;
65 bool _encodingMutable = true; 65 bool _encodingMutable = true;
66 66
67 _IOSinkImpl(StreamConsumer<List<int>, T> this._target, this._encoding); 67 _IOSinkImpl(StreamConsumer<List<int>, T> this._target, this._encoding);
68 68
69 Encoding _encoding; 69 Encoding _encoding;
70 70
71 Encoding get encoding => _encoding; 71 Encoding get encoding => _encoding;
72
72 void set encoding(Encoding value) { 73 void set encoding(Encoding value) {
73 if (!_encodingMutable) { 74 if (!_encodingMutable) {
74 throw new StateError("IOSink encoding is not mutable"); 75 throw new StateError("IOSink encoding is not mutable");
75 } 76 }
76 _encoding = value; 77 _encoding = value;
77 } 78 }
78 79
79 void write(Object obj) { 80 void write(Object obj) {
80 // This comment is copied from runtime/lib/string_buffer_patch.dart. 81 // This comment is copied from runtime/lib/string_buffer_patch.dart.
81 // TODO(srdjan): The following four lines could be replaced by 82 // TODO(srdjan): The following four lines could be replaced by
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 }, 225 },
225 onError: _controller.addError); 226 onError: _controller.addError);
226 if (_paused) _pause(); 227 if (_paused) _pause();
227 if (unbind) { 228 if (unbind) {
228 return _writeStreamCompleter.future; 229 return _writeStreamCompleter.future;
229 } else { 230 } else {
230 return _pipeFuture.then((_) => this); 231 return _pipeFuture.then((_) => this);
231 } 232 }
232 } 233 }
233 } 234 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | tests/standalone/io/stdout_stderr_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698