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

Unified Diff: test/dart_codegen/expect/convert/byte_conversion.dart

Issue 1148283010: Remove dart backend (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: test/dart_codegen/expect/convert/byte_conversion.dart
diff --git a/test/dart_codegen/expect/convert/byte_conversion.dart b/test/dart_codegen/expect/convert/byte_conversion.dart
deleted file mode 100644
index d4b387019e2bddcc5e66a3d7a20385f249b689ed..0000000000000000000000000000000000000000
--- a/test/dart_codegen/expect/convert/byte_conversion.dart
+++ /dev/null
@@ -1,49 +0,0 @@
-part of dart.convert;
- abstract class ByteConversionSink extends ChunkedConversionSink<List<int>> {ByteConversionSink();
- factory ByteConversionSink.withCallback(void callback(List<int> accumulated)) = _ByteCallbackSink;
- factory ByteConversionSink.from(Sink<List<int>> sink) = _ByteAdapterSink;
- void addSlice(List<int> chunk, int start, int end, bool isLast);
-}
- abstract class ByteConversionSinkBase extends ByteConversionSink {void add(List<int> chunk);
- void close();
- void addSlice(List<int> chunk, int start, int end, bool isLast) {
-add(chunk.sublist(start, end));
- if (isLast) close();
-}
-}
- class _ByteAdapterSink extends ByteConversionSinkBase {final Sink<List<int>> _sink;
- _ByteAdapterSink(this._sink);
- void add(List<int> chunk) => _sink.add(chunk);
- void close() => _sink.close();
-}
- class _ByteCallbackSink extends ByteConversionSinkBase {static const _INITIAL_BUFFER_SIZE = 1024;
- final _ChunkedConversionCallback<List<int>> _callback;
- List<int> _buffer = new Uint8List(_INITIAL_BUFFER_SIZE);
- int _bufferIndex = 0;
- _ByteCallbackSink(void callback(List<int> accumulated)) : this._callback = callback;
- void add(Iterable<int> chunk) {
-int freeCount = _buffer.length - _bufferIndex;
- if (chunk.length > freeCount) {
-int oldLength = _buffer.length;
- int newLength = _roundToPowerOf2(chunk.length + oldLength) * 2;
- List<int> grown = new Uint8List(newLength);
- grown.setRange(0, _buffer.length, _buffer);
- _buffer = grown;
-}
- _buffer.setRange(_bufferIndex, _bufferIndex + chunk.length, chunk);
- _bufferIndex += chunk.length;
-}
- static int _roundToPowerOf2(int v) {
-assert (v > 0); v--;
- v |= v >> 1;
- v |= v >> 2;
- v |= v >> 4;
- v |= v >> 8;
- v |= v >> 16;
- v++;
- return v;
-}
- void close() {
-_callback(_buffer.sublist(0, _bufferIndex));
-}
-}
« no previous file with comments | « test/dart_codegen/expect/convert/ascii.dart ('k') | test/dart_codegen/expect/convert/chunked_conversion.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698