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

Unified Diff: sdk/lib/io/http.dart

Issue 14914002: Change fromString constructor to parse static method (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed additional tests Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/http.dart ('k') | sdk/lib/io/http_headers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http.dart
diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart
index 845df54b968a24cd87c2d158a534692f3d99a740..47be232c868a1d46ca93dadfd8587eac85e13ada 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -451,12 +451,12 @@ abstract class HttpHeaders {
* request.headers.add(HttpHeaders.ACCEPT, v);
* request.headers.add(HttpHeaders.ACCEPT, "text/html");
*
- * To parse the header values use the [:fromString:] constructor.
+ * To parse the header values use the [:parse:] static method.
*
* HttpRequest request = ...;
* List<String> values = request.headers[HttpHeaders.ACCEPT];
* values.forEach((value) {
- * HeaderValue v = new HeaderValue.fromString(value);
+ * HeaderValue v = HeaderValue.parse(value);
* // Use v.value and v.parameters
* });
*
@@ -474,10 +474,9 @@ abstract class HeaderValue {
* Creates a new header value object from parsing a header value
* string with both value and optional parameters.
*/
- factory HeaderValue.fromString(String value,
- {String parameterSeparator: ";"}) {
- return new _HeaderValue.fromString(
- value, parameterSeparator: parameterSeparator);
+ static HeaderValue parse(String value,
+ {String parameterSeparator: ";"}) {
+ return _HeaderValue.parse(value, parameterSeparator: parameterSeparator);
}
/**
@@ -552,8 +551,8 @@ abstract class ContentType implements HeaderValue {
* will create a content type object with primary type [:text:], sub
* type [:html:] and parameter [:charset:] with value [:utf-8:].
*/
- factory ContentType.fromString(String value) {
- return new _ContentType.fromString(value);
+ static ContentType parse(String value) {
+ return _ContentType.parse(value);
}
/**
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/http.dart ('k') | sdk/lib/io/http_headers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698