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

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

Issue 10887023: Use new try-catch syntax in runtime/, tools/, and utils/. (Closed) Base URL: https://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_impl.dart ('k') | runtime/bin/http_utils.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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 540
541 default: 541 default:
542 // Should be unreachable. 542 // Should be unreachable.
543 assert(false); 543 assert(false);
544 break; 544 break;
545 } 545 }
546 546
547 // Move to the next byte. 547 // Move to the next byte.
548 index++; 548 index++;
549 } 549 }
550 } catch (var e) { 550 } catch (e) {
551 // Report the error through the error callback if any. Otherwise 551 // Report the error through the error callback if any. Otherwise
552 // throw the error. 552 // throw the error.
553 if (error != null) { 553 if (error != null) {
554 error(e); 554 error(e);
555 _state = _State.FAILURE; 555 _state = _State.FAILURE;
556 } else { 556 } else {
557 throw e; 557 throw e;
558 } 558 }
559 } 559 }
560 560
(...skipping 156 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/http_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698