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

Side by Side Diff: lib/src/media_type.dart

Issue 1950183003: Remove deprecated APIs. (Closed) Base URL: git@github.com:dart-lang/http_parser@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « lib/src/authentication_challenge.dart ('k') | lib/src/scan.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 import 'package:collection/collection.dart'; 5 import 'package:collection/collection.dart';
6 import 'package:string_scanner/string_scanner.dart'; 6 import 'package:string_scanner/string_scanner.dart';
7 7
8 import 'case_insensitive_map.dart'; 8 import 'case_insensitive_map.dart';
9 import 'scan.dart'; 9 import 'scan.dart';
10 import 'utils.dart'; 10 import 'utils.dart';
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 return wrapFormatException("media type", mediaType, () { 46 return wrapFormatException("media type", mediaType, () {
47 var scanner = new StringScanner(mediaType); 47 var scanner = new StringScanner(mediaType);
48 scanner.scan(whitespace); 48 scanner.scan(whitespace);
49 scanner.expect(token); 49 scanner.expect(token);
50 var type = scanner.lastMatch[0]; 50 var type = scanner.lastMatch[0];
51 scanner.expect('/'); 51 scanner.expect('/');
52 scanner.expect(token); 52 scanner.expect(token);
53 var subtype = scanner.lastMatch[0]; 53 var subtype = scanner.lastMatch[0];
54 scanner.scan(whitespace); 54 scanner.scan(whitespace);
55 55
56 var parameters = {}; 56 var parameters = <String, String>{};
57 while (scanner.scan(';')) { 57 while (scanner.scan(';')) {
58 scanner.scan(whitespace); 58 scanner.scan(whitespace);
59 scanner.expect(token); 59 scanner.expect(token);
60 var attribute = scanner.lastMatch[0]; 60 var attribute = scanner.lastMatch[0];
61 scanner.expect('='); 61 scanner.expect('=');
62 62
63 var value; 63 var value;
64 if (scanner.scan(token)) { 64 if (scanner.scan(token)) {
65 value = scanner.lastMatch[0]; 65 value = scanner.lastMatch[0];
66 } else { 66 } else {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 value.replaceAllMapped(_escapedChar, (match) => "\\" + match[0])) 141 value.replaceAllMapped(_escapedChar, (match) => "\\" + match[0]))
142 ..write('"'); 142 ..write('"');
143 } else { 143 } else {
144 buffer.write(value); 144 buffer.write(value);
145 } 145 }
146 }); 146 });
147 147
148 return buffer.toString(); 148 return buffer.toString();
149 } 149 }
150 } 150 }
OLDNEW
« no previous file with comments | « lib/src/authentication_challenge.dart ('k') | lib/src/scan.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698