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

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

Issue 13956006: Remove insertRange. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Replace type with var.wq 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 class _HttpIncoming extends Stream<List<int>> { 7 class _HttpIncoming extends Stream<List<int>> {
8 final int _transferLength; 8 final int _transferLength;
9 final Completer _dataCompleter = new Completer(); 9 final Completer _dataCompleter = new Completer();
10 Stream<List<int>> _stream; 10 Stream<List<int>> _stream;
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 } 856 }
857 857
858 static List<int> _chunkHeader(int length) { 858 static List<int> _chunkHeader(int length) {
859 const hexDigits = const [0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 859 const hexDigits = const [0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
860 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46]; 860 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46];
861 var header = []; 861 var header = [];
862 if (length == 0) { 862 if (length == 0) {
863 header.add(hexDigits[length]); 863 header.add(hexDigits[length]);
864 } else { 864 } else {
865 while (length > 0) { 865 while (length > 0) {
866 header.insertRange(0, 1, hexDigits[length % 16]); 866 header.insert(0, hexDigits[length % 16]);
867 length = length >> 4; 867 length = length >> 4;
868 } 868 }
869 } 869 }
870 header.add(_CharCode.CR); 870 header.add(_CharCode.CR);
871 header.add(_CharCode.LF); 871 header.add(_CharCode.LF);
872 return header; 872 return header;
873 } 873 }
874 874
875 // Footer is just a CRLF. 875 // Footer is just a CRLF.
876 static List<int> get _chunkFooter => const [_CharCode.CR, _CharCode.LF]; 876 static List<int> get _chunkFooter => const [_CharCode.CR, _CharCode.LF];
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 1826
1827 1827
1828 class _RedirectInfo implements RedirectInfo { 1828 class _RedirectInfo implements RedirectInfo {
1829 const _RedirectInfo(int this.statusCode, 1829 const _RedirectInfo(int this.statusCode,
1830 String this.method, 1830 String this.method,
1831 Uri this.location); 1831 Uri this.location);
1832 final int statusCode; 1832 final int statusCode;
1833 final String method; 1833 final String method;
1834 final Uri location; 1834 final Uri location;
1835 } 1835 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698