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

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

Issue 10913096: Minor code cleanup (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « runtime/bin/http.dart ('k') | runtime/bin/websocket_impl.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) 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 const HTTP = const [72, 84, 84, 80]; 8 static const HTTP = const [72, 84, 84, 80];
9 // Bytes for "HTTP/1.". 9 // Bytes for "HTTP/1.".
10 static const HTTP1DOT = const [72, 84, 84, 80, 47, 49, 46]; 10 static const HTTP1DOT = const [72, 84, 84, 80, 47, 49, 46];
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 return; 592 return;
593 } 593 }
594 throw e; 594 throw e;
595 } 595 }
596 } 596 }
597 597
598 String get version { 598 String get version {
599 switch (_httpVersion) { 599 switch (_httpVersion) {
600 case _HttpVersion.HTTP10: 600 case _HttpVersion.HTTP10:
601 return "1.0"; 601 return "1.0";
602 break;
603 case _HttpVersion.HTTP11: 602 case _HttpVersion.HTTP11:
604 return "1.1"; 603 return "1.1";
605 break;
606 } 604 }
607 return null; 605 return null;
608 } 606 }
609 607
610 int get messageType => _messageType; 608 int get messageType => _messageType;
611 int get contentLength => _contentLength; 609 int get contentLength => _contentLength;
612 bool get upgrade => _connectionUpgrade && _state == _State.UPGRADED; 610 bool get upgrade => _connectionUpgrade && _state == _State.UPGRADED;
613 bool get persistentConnection => _persistentConnection; 611 bool get persistentConnection => _persistentConnection;
614 612
615 void set responseToMethod(String method) { _responseToMethod = method; } 613 void set responseToMethod(String method) { _responseToMethod = method; }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 Function dataEnd; 715 Function dataEnd;
718 Function error; 716 Function error;
719 } 717 }
720 718
721 719
722 class HttpParserException implements Exception { 720 class HttpParserException implements Exception {
723 const HttpParserException([String this.message = ""]); 721 const HttpParserException([String this.message = ""]);
724 String toString() => "HttpParserException: $message"; 722 String toString() => "HttpParserException: $message";
725 final String message; 723 final String message;
726 } 724 }
OLDNEW
« no previous file with comments | « runtime/bin/http.dart ('k') | runtime/bin/websocket_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698