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

Side by Side Diff: sdk/lib/io/http_impl.dart

Issue 2529393002: Make core libraries use generic method syntax. (Closed)
Patch Set: Update status files. Created 3 years, 11 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
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | sdk/lib/io/http_parser.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart.io; 5 part of dart.io;
6 6
7 const int _OUTGOING_BUFFER_SIZE = 8 * 1024; 7 const int _OUTGOING_BUFFER_SIZE = 8 * 1024;
8 8
9 typedef void _BytesConsumer(List<int> bytes); 9 typedef void _BytesConsumer(List<int> bytes);
10 10
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 757
758 HttpConnectionInfo get connectionInfo => _httpClientConnection.connectionInfo; 758 HttpConnectionInfo get connectionInfo => _httpClientConnection.connectionInfo;
759 759
760 void _onIncoming(_HttpIncoming incoming) { 760 void _onIncoming(_HttpIncoming incoming) {
761 var response = new _HttpClientResponse(incoming, this, _httpClient); 761 var response = new _HttpClientResponse(incoming, this, _httpClient);
762 Future<HttpClientResponse> future; 762 Future<HttpClientResponse> future;
763 if (followRedirects && response.isRedirect) { 763 if (followRedirects && response.isRedirect) {
764 if (response.redirects.length < maxRedirects) { 764 if (response.redirects.length < maxRedirects) {
765 // Redirect and drain response. 765 // Redirect and drain response.
766 future = response.drain() 766 future = response.drain()
767 .then/*<HttpClientResponse>*/((_) => response.redirect()); 767 .then<HttpClientResponse>((_) => response.redirect());
768 } else { 768 } else {
769 // End with exception, too many redirects. 769 // End with exception, too many redirects.
770 future = response.drain() 770 future = response.drain()
771 .then/*<HttpClientResponse>*/((_) { 771 .then<HttpClientResponse>((_) {
772 return new Future<HttpClientResponse>.error( 772 return new Future<HttpClientResponse>.error(
773 new RedirectException("Redirect limit exceeded", 773 new RedirectException("Redirect limit exceeded",
774 response.redirects)); 774 response.redirects));
775 }); 775 });
776 } 776 }
777 } else if (response._shouldAuthenticateProxy) { 777 } else if (response._shouldAuthenticateProxy) {
778 future = response._authenticate(true); 778 future = response._authenticate(true);
779 } else if (response._shouldAuthenticate) { 779 } else if (response._shouldAuthenticate) {
780 future = response._authenticate(false); 780 future = response._authenticate(false);
781 } else { 781 } else {
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 // Look for credentials. 1384 // Look for credentials.
1385 creds = _httpClient._findCredentials(uri); 1385 creds = _httpClient._findCredentials(uri);
1386 if (creds != null) { 1386 if (creds != null) {
1387 creds.authorize(request); 1387 creds.authorize(request);
1388 } 1388 }
1389 } 1389 }
1390 // Start sending the request (lazy, delayed until the user provides 1390 // Start sending the request (lazy, delayed until the user provides
1391 // data). 1391 // data).
1392 _httpParser.isHead = method == "HEAD"; 1392 _httpParser.isHead = method == "HEAD";
1393 _streamFuture = outgoing.done 1393 _streamFuture = outgoing.done
1394 .then/*<Socket>*/((Socket s) { 1394 .then<Socket>((Socket s) {
1395 // Request sent, set up response completer. 1395 // Request sent, set up response completer.
1396 _nextResponseCompleter = new Completer(); 1396 _nextResponseCompleter = new Completer();
1397 1397
1398 // Listen for response. 1398 // Listen for response.
1399 _nextResponseCompleter.future 1399 _nextResponseCompleter.future
1400 .then((incoming) { 1400 .then((incoming) {
1401 _currentUri = null; 1401 _currentUri = null;
1402 incoming.dataDone.then((closing) { 1402 incoming.dataDone.then((closing) {
1403 if (incoming.upgraded) { 1403 if (incoming.upgraded) {
1404 _httpClient._connectionClosed(this); 1404 _httpClient._connectionClosed(this);
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
2891 const _RedirectInfo(this.statusCode, this.method, this.location); 2891 const _RedirectInfo(this.statusCode, this.method, this.location);
2892 } 2892 }
2893 2893
2894 String _getHttpVersion() { 2894 String _getHttpVersion() {
2895 var version = Platform.version; 2895 var version = Platform.version;
2896 // Only include major and minor version numbers. 2896 // Only include major and minor version numbers.
2897 int index = version.indexOf('.', version.indexOf('.') + 1); 2897 int index = version.indexOf('.', version.indexOf('.') + 1);
2898 version = version.substring(0, index); 2898 version = version.substring(0, index);
2899 return 'Dart/$version (dart:io)'; 2899 return 'Dart/$version (dart:io)';
2900 } 2900 }
OLDNEW
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | sdk/lib/io/http_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698