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

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

Issue 10389017: Add Exception to the class name for recently added exception classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/http.dart ('k') | tests/standalone/io/http_redirect_test.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 class _HttpHeaders implements HttpHeaders { 5 class _HttpHeaders implements HttpHeaders {
6 _HttpHeaders() : _headers = new Map<String, List<String>>(); 6 _HttpHeaders() : _headers = new Map<String, List<String>>();
7 7
8 List<String> operator[](String name) { 8 List<String> operator[](String name) {
9 name = name.toLowerCase(); 9 name = name.toLowerCase();
10 return _headers[name]; 10 return _headers[name];
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 if (location == null || location.length > 1) { 1186 if (location == null || location.length > 1) {
1187 throw new RedirectException("Invalid redirect", 1187 throw new RedirectException("Invalid redirect",
1188 _connection._redirects); 1188 _connection._redirects);
1189 } 1189 }
1190 // Check for redirect loop 1190 // Check for redirect loop
1191 if (_connection._redirects != null) { 1191 if (_connection._redirects != null) {
1192 Uri redirectUrl = new Uri.fromString(location[0]); 1192 Uri redirectUrl = new Uri.fromString(location[0]);
1193 for (int i = 0; i < _connection._redirects.length; i++) { 1193 for (int i = 0; i < _connection._redirects.length; i++) {
1194 if (_connection._redirects[i].location.toString() == 1194 if (_connection._redirects[i].location.toString() ==
1195 redirectUrl.toString()) { 1195 redirectUrl.toString()) {
1196 throw new RedirectLoop(_connection._redirects); 1196 throw new RedirectLoopException(_connection._redirects);
1197 } 1197 }
1198 } 1198 }
1199 } 1199 }
1200 // Drain body and redirect. 1200 // Drain body and redirect.
1201 inputStream.onData = inputStream.read; 1201 inputStream.onData = inputStream.read;
1202 inputStream.onClosed = _connection.redirect; 1202 inputStream.onClosed = _connection.redirect;
1203 } else { 1203 } else {
1204 throw new RedirectLimitExceeded(_connection._redirects); 1204 throw new RedirectLimitExceededException(_connection._redirects);
1205 } 1205 }
1206 } else if (_connection._onResponse != null) { 1206 } else if (_connection._onResponse != null) {
1207 _connection._onResponse(this); 1207 _connection._onResponse(this);
1208 } 1208 }
1209 } 1209 }
1210 1210
1211 void _onDataReceived(List<int> data) { 1211 void _onDataReceived(List<int> data) {
1212 _buffer.add(data); 1212 _buffer.add(data);
1213 if (_inputStream != null) _inputStream._dataReceived(); 1213 if (_inputStream != null) _inputStream._dataReceived();
1214 } 1214 }
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 1631
1632 1632
1633 class _RedirectInfo implements RedirectInfo { 1633 class _RedirectInfo implements RedirectInfo {
1634 const _RedirectInfo(int this.statusCode, 1634 const _RedirectInfo(int this.statusCode,
1635 String this.method, 1635 String this.method,
1636 Uri this.location); 1636 Uri this.location);
1637 final int statusCode; 1637 final int statusCode;
1638 final String method; 1638 final String method;
1639 final Uri location; 1639 final Uri location;
1640 } 1640 }
OLDNEW
« no previous file with comments | « runtime/bin/http.dart ('k') | tests/standalone/io/http_redirect_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698