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

Side by Side Diff: tool/input_sdk/lib/convert/chunked_conversion.dart

Issue 1554683002: Update to latest analyzer (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « tool/input_sdk/lib/collection/set.dart ('k') | tool/input_sdk/lib/core/iterable.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.convert; 5 part of dart.convert;
6 6
7 typedef void _ChunkedConversionCallback<T>(T accumulated); 7 typedef void _ChunkedConversionCallback<T>(T accumulated);
8 8
9 /** 9 /**
10 * A [ChunkedConversionSink] is used to transmit data more efficiently between 10 * A [ChunkedConversionSink] is used to transmit data more efficiently between
11 * two converters during chunked conversions. 11 * two converters during chunked conversions.
12 * 12 *
13 * The basic `ChunkedConversionSink` is just a [Sink], and converters should 13 * The basic `ChunkedConversionSink` is just a [Sink], and converters should
14 * work with a plain `Sink`, but may work more efficiently with certain 14 * work with a plain `Sink`, but may work more efficiently with certain
15 * specialized types of `ChunkedConversionSink`. 15 * specialized types of `ChunkedConversionSink`.
16 * 16 *
17 * It is recommended that implementations of `ChunkedConversionSink` extends 17 * It is recommended that implementations of `ChunkedConversionSink` extends
18 * this class, to inherit any further methods that may be added to the class. 18 * this class, to inherit any further methods that may be added to the class.
19 */ 19 */
20 abstract class ChunkedConversionSink<T> implements Sink<T> { 20 abstract class ChunkedConversionSink<T> implements Sink<T> {
21 ChunkedConversionSink(); 21 ChunkedConversionSink();
22 factory ChunkedConversionSink.withCallback( 22 factory ChunkedConversionSink.withCallback(
23 void callback(List<T> accumulated)) = _SimpleCallbackSink; 23 void callback(List<T> accumulated)) = _SimpleCallbackSink<T>;
24 24
25 /** 25 /**
26 * Adds chunked data to this sink. 26 * Adds chunked data to this sink.
27 * 27 *
28 * This method is also used when converters are used as [StreamTransformer]s. 28 * This method is also used when converters are used as [StreamTransformer]s.
29 */ 29 */
30 void add(T chunk); 30 void add(T chunk);
31 31
32 /** 32 /**
33 * Closes the sink. 33 * Closes the sink.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 _ConverterStreamEventSink(Converter converter, EventSink<T> sink) 85 _ConverterStreamEventSink(Converter converter, EventSink<T> sink)
86 : this._eventSink = sink, 86 : this._eventSink = sink,
87 _chunkedSink = converter.startChunkedConversion(sink); 87 _chunkedSink = converter.startChunkedConversion(sink);
88 88
89 void add(S o) => _chunkedSink.add(o); 89 void add(S o) => _chunkedSink.add(o);
90 void addError(Object error, [StackTrace stackTrace]) { 90 void addError(Object error, [StackTrace stackTrace]) {
91 _eventSink.addError(error, stackTrace); 91 _eventSink.addError(error, stackTrace);
92 } 92 }
93 void close() => _chunkedSink.close(); 93 void close() => _chunkedSink.close();
94 } 94 }
OLDNEW
« no previous file with comments | « tool/input_sdk/lib/collection/set.dart ('k') | tool/input_sdk/lib/core/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698