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

Unified Diff: sdk/lib/_internal/pub/lib/src/utils.dart

Issue 16019002: Merge the dart:uri library into dart:core and update the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final cleanup 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/safe_http_server.dart ('k') | sdk/lib/_internal/pub/test/oauth2/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/utils.dart
diff --git a/sdk/lib/_internal/pub/lib/src/utils.dart b/sdk/lib/_internal/pub/lib/src/utils.dart
index 76defb057f5bfa36d3d0a5bf267284043fc10651..5414d5df7f8e73b6a50e22e87927143d117db842 100644
--- a/sdk/lib/_internal/pub/lib/src/utils.dart
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart
@@ -11,7 +11,6 @@ import 'dart:io';
import 'dart:isolate';
import 'dart:json' as json;
import 'dart:mirrors';
-import 'dart:uri';
import 'package:pathos/path.dart' as path;
@@ -321,8 +320,9 @@ Map<String, String> queryToMap(String queryList) {
String mapToQuery(Map<String, String> map) {
var pairs = <List<String>>[];
map.forEach((key, value) {
- key = encodeUriComponent(key);
- value = (value == null || value.isEmpty) ? null : encodeUriComponent(value);
+ key = Uri.encodeQueryComponent(key);
+ value = (value == null || value.isEmpty)
+ ? null : Uri.encodeQueryComponent(value);
pairs.add([key, value]);
});
return pairs.map((pair) {
@@ -339,13 +339,6 @@ bool urisEqual(Uri uri1, Uri uri2) =>
/// Return [uri] with redundant port information removed.
Uri canonicalizeUri(Uri uri) {
- if (uri == null) return null;
-
- var sansPort = new Uri.fromComponents(
- scheme: uri.scheme, userInfo: uri.userInfo, domain: uri.domain,
- path: uri.path, query: uri.query, fragment: uri.fragment);
- if (uri.scheme == 'http' && uri.port == 80) return sansPort;
- if (uri.scheme == 'https' && uri.port == 443) return sansPort;
return uri;
}
@@ -354,10 +347,10 @@ Uri canonicalizeUri(Uri uri) {
void mapAddAll(Map destination, Map source) =>
source.forEach((key, value) => destination[key] = value);
-/// Decodes a URL-encoded string. Unlike [decodeUriComponent], this includes
+/// Decodes a URL-encoded string. Unlike [Uri.decodeComponent], this includes
/// replacing `+` with ` `.
String urlDecode(String encoded) =>
- decodeUriComponent(encoded.replaceAll("+", " "));
+ Uri.decodeComponent(encoded.replaceAll("+", " "));
/// Takes a simple data structure (composed of [Map]s, [Iterable]s, scalar
/// objects, and [Future]s) and recursively resolves all the [Future]s contained
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/safe_http_server.dart ('k') | sdk/lib/_internal/pub/test/oauth2/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698