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

Side by Side Diff: runtime/bin/http_parser.dart

Issue 10082003: Start refactoring of the HTTP header handling (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 8 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Global constants. 5 // Global constants.
6 class _Const { 6 class _Const {
7 // Bytes for "HTTP". 7 // Bytes for "HTTP".
8 static final HTTP = const [72, 84, 84, 80]; 8 static final HTTP = const [72, 84, 84, 80];
9 // Bytes for "HTTP/1.". 9 // Bytes for "HTTP/1.".
10 static final HTTP1DOT = const [72, 84, 84, 80, 47, 49, 46]; 10 static final HTTP1DOT = const [72, 84, 84, 80, 47, 49, 46];
(...skipping 14 matching lines...) Expand all
25 32, 9, 13, 10]; 25 32, 9, 13, 10];
26 } 26 }
27 27
28 28
29 // Frequently used character codes. 29 // Frequently used character codes.
30 class _CharCode { 30 class _CharCode {
31 static final int HT = 9; 31 static final int HT = 9;
32 static final int LF = 10; 32 static final int LF = 10;
33 static final int CR = 13; 33 static final int CR = 13;
34 static final int SP = 32; 34 static final int SP = 32;
35 static final int COMMA = 44;
35 static final int SLASH = 47; 36 static final int SLASH = 47;
36 static final int ZERO = 48; 37 static final int ZERO = 48;
37 static final int ONE = 49; 38 static final int ONE = 49;
38 static final int COLON = 58; 39 static final int COLON = 58;
39 static final int SEMI_COLON = 59; 40 static final int SEMI_COLON = 59;
40 } 41 }
41 42
42 43
43 // States of the HTTP parser state machine. 44 // States of the HTTP parser state machine.
44 class _State { 45 class _State {
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 Function dataEnd; 694 Function dataEnd;
694 Function error; 695 Function error;
695 } 696 }
696 697
697 698
698 class HttpParserException implements Exception { 699 class HttpParserException implements Exception {
699 const HttpParserException([String this.message = ""]); 700 const HttpParserException([String this.message = ""]);
700 String toString() => "HttpParserException: $message"; 701 String toString() => "HttpParserException: $message";
701 final String message; 702 final String message;
702 } 703 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698