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

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

Issue 10872033: Change getters syntax in dart:io library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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_impl.dart ('k') | runtime/bin/input_stream.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 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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 var e = new HttpParserException( 588 var e = new HttpParserException(
589 "Connection closed before full body was received"); 589 "Connection closed before full body was received");
590 if (error != null) { 590 if (error != null) {
591 error(e); 591 error(e);
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; 602 break;
603 case _HttpVersion.HTTP11: 603 case _HttpVersion.HTTP11:
604 return "1.1"; 604 return "1.1";
605 break; 605 break;
606 } 606 }
607 return null; 607 return null;
608 } 608 }
609 609
610 int get messageType() => _messageType; 610 int get messageType => _messageType;
611 int get contentLength() => _contentLength; 611 int get contentLength => _contentLength;
612 bool get upgrade() => _connectionUpgrade && _state == _State.UPGRADED; 612 bool get upgrade => _connectionUpgrade && _state == _State.UPGRADED;
613 bool get persistentConnection() => _persistentConnection; 613 bool get persistentConnection => _persistentConnection;
614 614
615 void set responseToMethod(String method) { _responseToMethod = method; } 615 void set responseToMethod(String method) { _responseToMethod = method; }
616 616
617 bool get isIdle() => _state == _State.START; 617 bool get isIdle => _state == _State.START;
618 618
619 List<int> get unparsedData() => _unparsedData; 619 List<int> get unparsedData => _unparsedData;
620 620
621 void _bodyEnd() { 621 void _bodyEnd() {
622 if (dataEnd != null) { 622 if (dataEnd != null) {
623 dataEnd(_messageType == _MessageType.RESPONSE && !_persistentConnection); 623 dataEnd(_messageType == _MessageType.RESPONSE && !_persistentConnection);
624 } 624 }
625 } 625 }
626 626
627 _reset() { 627 _reset() {
628 _state = _State.START; 628 _state = _State.START;
629 _messageType = _MessageType.UNDETERMINED; 629 _messageType = _MessageType.UNDETERMINED;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 Function dataEnd; 717 Function dataEnd;
718 Function error; 718 Function error;
719 } 719 }
720 720
721 721
722 class HttpParserException implements Exception { 722 class HttpParserException implements Exception {
723 const HttpParserException([String this.message = ""]); 723 const HttpParserException([String this.message = ""]);
724 String toString() => "HttpParserException: $message"; 724 String toString() => "HttpParserException: $message";
725 final String message; 725 final String message;
726 } 726 }
OLDNEW
« no previous file with comments | « runtime/bin/http_impl.dart ('k') | runtime/bin/input_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698