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

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

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added co19 issue number. Created 7 years, 8 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 | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/link.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 // Global constants. 7 // Global constants.
8 class _Const { 8 class _Const {
9 // Bytes for "HTTP". 9 // Bytes for "HTTP".
10 static const HTTP = const [72, 84, 84, 80]; 10 static const HTTP = const [72, 84, 84, 80];
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 _onData, 224 _onData,
225 onError: _onError, 225 onError: _onError,
226 onDone: () { 226 onDone: () {
227 completer.complete(this); 227 completer.complete(this);
228 }); 228 });
229 return completer.future; 229 return completer.future;
230 } 230 }
231 231
232 Future<_HttpParser> close() { 232 Future<_HttpParser> close() {
233 _onDone(); 233 _onDone();
234 return new Future.immediate(this); 234 return new Future.value(this);
235 } 235 }
236 236
237 // From RFC 2616. 237 // From RFC 2616.
238 // generic-message = start-line 238 // generic-message = start-line
239 // *(message-header CRLF) 239 // *(message-header CRLF)
240 // CRLF 240 // CRLF
241 // [ message-body ] 241 // [ message-body ]
242 // start-line = Request-Line | Status-Line 242 // start-line = Request-Line | Status-Line
243 // Request-Line = Method SP Request-URI SP HTTP-Version CRLF 243 // Request-Line = Method SP Request-URI SP HTTP-Version CRLF
244 // Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF 244 // Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 StreamController<_HttpIncoming> _controller; 958 StreamController<_HttpIncoming> _controller;
959 StreamController<List<int>> _bodyController; 959 StreamController<List<int>> _bodyController;
960 } 960 }
961 961
962 962
963 class HttpParserException implements Exception { 963 class HttpParserException implements Exception {
964 const HttpParserException([String this.message = ""]); 964 const HttpParserException([String this.message = ""]);
965 String toString() => "HttpParserException: $message"; 965 String toString() => "HttpParserException: $message";
966 final String message; 966 final String message;
967 } 967 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/link.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698