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

Unified Diff: pkg/oauth2/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
Index: pkg/oauth2/lib/src/utils.dart
diff --git a/pkg/oauth2/lib/src/utils.dart b/pkg/oauth2/lib/src/utils.dart
index f69ac8b194436c61db0439ad6b40d4cccf0cba79..b47adcbf283c6fcd427b13626c905685b615e38e 100644
--- a/pkg/oauth2/lib/src/utils.dart
+++ b/pkg/oauth2/lib/src/utils.dart
@@ -5,7 +5,6 @@
library utils;
import 'dart:async';
-import 'dart:uri';
import 'dart:isolate';
import 'dart:crypto';
@@ -35,8 +34,10 @@ 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) {
@@ -50,10 +51,10 @@ String mapToQuery(Map<String, String> map) {
void mapAddAll(Map destination, Map source) =>
source.forEach((key, value) => destination[key] = value);
-/// Decode a URL-encoded string. Unlike [decodeUriComponent], this includes
+/// Decode 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 a list of two elements or fewer.
« no previous file with comments | « pkg/oauth2/lib/src/handle_access_token_response.dart ('k') | pkg/oauth2/test/authorization_code_grant_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698