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

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

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebuild DOM and rebase. Created 7 years, 8 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
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 * Private helper-class to handle native filters. 8 * Private helper-class to handle native filters.
9 */ 9 */
10 abstract class _Filter { 10 abstract class _Filter {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 if (_closed) return; 44 if (_closed) return;
45 try { 45 try {
46 _empty = false; 46 _empty = false;
47 _filter.process(data); 47 _filter.process(data);
48 var out; 48 var out;
49 while ((out = _filter.processed(flush: false)) != null) { 49 while ((out = _filter.processed(flush: false)) != null) {
50 sink.add(out); 50 sink.add(out);
51 } 51 }
52 } catch (e, s) { 52 } catch (e, s) {
53 _closed = true; 53 _closed = true;
54 sink.addError(new AsyncError(e, s)); 54 sink.addError(e, s);
55 sink.close(); 55 sink.close();
56 } 56 }
57 } 57 }
58 58
59 void handleDone(EventSink<List<int>> sink) { 59 void handleDone(EventSink<List<int>> sink) {
60 if (_closed) return; 60 if (_closed) return;
61 if (_empty) _filter.process(const []); 61 if (_empty) _filter.process(const []);
62 try { 62 try {
63 var out; 63 var out;
64 while ((out = _filter.processed()) != null) { 64 while ((out = _filter.processed()) != null) {
65 sink.add(out); 65 sink.add(out);
66 } 66 }
67 } catch (e, s) { 67 } catch (e, s) {
68 sink.addError(new AsyncError(e, s)); 68 sink.addError(e, s);
69 _closed = true; 69 _closed = true;
70 } 70 }
71 if (!_closed) _filter.end(); 71 if (!_closed) _filter.end();
72 _closed = true; 72 _closed = true;
73 sink.close(); 73 sink.close();
74 } 74 }
75 } 75 }
76 76
77 77
78 /** 78 /**
79 * ZLibDeflater class used to deflate a stream of bytes, using zlib. 79 * ZLibDeflater class used to deflate a stream of bytes, using zlib.
80 */ 80 */
81 class ZLibDeflater extends _FilterTransformer { 81 class ZLibDeflater extends _FilterTransformer {
82 ZLibDeflater({bool gzip: true, int level: 6}) 82 ZLibDeflater({bool gzip: true, int level: 6})
83 : super(_Filter.newZLibDeflateFilter(gzip, level)); 83 : super(_Filter.newZLibDeflateFilter(gzip, level));
84 } 84 }
85 85
86 86
87 /** 87 /**
88 * ZLibInflater class used to inflate a stream of bytes, using zlib. 88 * ZLibInflater class used to inflate a stream of bytes, using zlib.
89 */ 89 */
90 class ZLibInflater extends _FilterTransformer { 90 class ZLibInflater extends _FilterTransformer {
91 ZLibInflater() : super(_Filter.newZLibInflateFilter()); 91 ZLibInflater() : super(_Filter.newZLibInflateFilter());
92 } 92 }
93 93
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698