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

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

Issue 12282038: Remove deprecated string features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head 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 | « sdk/lib/io/base64.dart ('k') | sdk/lib/io/http_parser.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 class _HttpHeaders implements HttpHeaders { 7 class _HttpHeaders implements HttpHeaders {
8 _HttpHeaders(String this.protocolVersion) 8 _HttpHeaders(String this.protocolVersion)
9 : _headers = new Map<String, List<String>>(); 9 : _headers = new Map<String, List<String>>();
10 10
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 345
346 void writeBuffer() { 346 void writeBuffer() {
347 sink.add(buffer.getRange(0, bufferPos)); 347 sink.add(buffer.getRange(0, bufferPos));
348 bufferPos = 0; 348 bufferPos = 0;
349 } 349 }
350 350
351 // Format headers. 351 // Format headers.
352 _headers.forEach((String name, List<String> values) { 352 _headers.forEach((String name, List<String> values) {
353 bool fold = _foldHeader(name); 353 bool fold = _foldHeader(name);
354 List<int> nameData; 354 List<int> nameData;
355 nameData = name.charCodes; 355 nameData = name.codeUnits;
356 int nameDataLen = nameData.length; 356 int nameDataLen = nameData.length;
357 if (nameDataLen + 2 > bufferSize - bufferPos) writeBuffer(); 357 if (nameDataLen + 2 > bufferSize - bufferPos) writeBuffer();
358 buffer.setRange(bufferPos, nameDataLen, nameData); 358 buffer.setRange(bufferPos, nameDataLen, nameData);
359 bufferPos += nameDataLen; 359 bufferPos += nameDataLen;
360 buffer[bufferPos++] = _CharCode.COLON; 360 buffer[bufferPos++] = _CharCode.COLON;
361 buffer[bufferPos++] = _CharCode.SP; 361 buffer[bufferPos++] = _CharCode.SP;
362 for (int i = 0; i < values.length; i++) { 362 for (int i = 0; i < values.length; i++) {
363 List<int> data = values[i].charCodes; 363 List<int> data = values[i].codeUnits;
364 int dataLen = data.length; 364 int dataLen = data.length;
365 // Worst case here is writing the name, value and 6 additional bytes. 365 // Worst case here is writing the name, value and 6 additional bytes.
366 if (nameDataLen + dataLen + 6 > bufferSize - bufferPos) writeBuffer(); 366 if (nameDataLen + dataLen + 6 > bufferSize - bufferPos) writeBuffer();
367 if (i > 0) { 367 if (i > 0) {
368 if (fold) { 368 if (fold) {
369 buffer[bufferPos++] = _CharCode.COMMA; 369 buffer[bufferPos++] = _CharCode.COMMA;
370 buffer[bufferPos++] = _CharCode.SP; 370 buffer[bufferPos++] = _CharCode.SP;
371 } else { 371 } else {
372 buffer[bufferPos++] = _CharCode.CR; 372 buffer[bufferPos++] = _CharCode.CR;
373 buffer[bufferPos++] = _CharCode.LF; 373 buffer[bufferPos++] = _CharCode.LF;
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 777
778 String name; 778 String name;
779 String value; 779 String value;
780 DateTime expires; 780 DateTime expires;
781 int maxAge; 781 int maxAge;
782 String domain; 782 String domain;
783 String path; 783 String path;
784 bool httpOnly = false; 784 bool httpOnly = false;
785 bool secure = false; 785 bool secure = false;
786 } 786 }
OLDNEW
« no previous file with comments | « sdk/lib/io/base64.dart ('k') | sdk/lib/io/http_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698