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

Unified Diff: pkg/http/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 | « pkg/http/lib/src/streamed_request.dart ('k') | pkg/http/test/client_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/utils.dart
diff --git a/pkg/http/lib/src/utils.dart b/pkg/http/lib/src/utils.dart
index ba5c968868fc45581ff43804eee4ad12f5d4d12e..5092ed1e6abf3530e00b4fd189bc37d0f39c62d5 100644
--- a/pkg/http/lib/src/utils.dart
+++ b/pkg/http/lib/src/utils.dart
@@ -8,7 +8,6 @@ import 'dart:async';
import 'dart:crypto';
import 'dart:io';
import 'dart:typed_data';
-import 'dart:uri';
import 'dart:utf';
import 'byte_stream.dart';
@@ -37,7 +36,8 @@ Map<String, String> queryToMap(String queryList) {
String mapToQuery(Map<String, String> map) {
var pairs = <List<String>>[];
map.forEach((key, value) =>
- pairs.add([encodeUriComponent(key), encodeUriComponent(value)]));
+ pairs.add([Uri.encodeQueryComponent(key),
+ Uri.encodeQueryComponent(value)]));
return pairs.map((pair) => "${pair[0]}=${pair[1]}").join("&");
}
@@ -50,10 +50,10 @@ String mapToQuery(Map<String, String> map) {
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("+", " "));
/// Like [String.split], but only splits on the first occurrence of the pattern.
/// This will always return an array of two elements or fewer.
« no previous file with comments | « pkg/http/lib/src/streamed_request.dart ('k') | pkg/http/test/client_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698