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

Unified Diff: pkg/oauth2/lib/src/credentials.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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/oauth2/lib/src/client.dart ('k') | pkg/oauth2/lib/src/handle_access_token_response.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/oauth2/lib/src/credentials.dart
diff --git a/pkg/oauth2/lib/src/credentials.dart b/pkg/oauth2/lib/src/credentials.dart
index 89af777118282250eea4958a0ae9ec50a1a835a0..12a0be8fd82f816133bc8c9346903c2643c72c1e 100644
--- a/pkg/oauth2/lib/src/credentials.dart
+++ b/pkg/oauth2/lib/src/credentials.dart
@@ -4,7 +4,8 @@
library credentials;
-import 'dart:json';
+import 'dart:async';
+import 'dart:json' as JSON;
import 'dart:uri';
import '../../../http/lib/http.dart' as http;
@@ -152,7 +153,7 @@ class Credentials {
if (httpClient == null) httpClient = new http.Client();
var startTime = new Date.now();
- return async.chain((_) {
+ return async.then((_) {
if (refreshToken == null) {
throw new StateError("Can't refresh credentials without a refresh "
"token.");
@@ -173,10 +174,10 @@ class Credentials {
if (!scopes.isEmpty) fields["scope"] = Strings.join(scopes, ' ');
return httpClient.post(tokenEndpoint, fields: fields);
- }).transform((response) {
+ }).then((response) {
return handleAccessTokenResponse(
response, tokenEndpoint, startTime, scopes);
- }).transform((credentials) {
+ }).then((credentials) {
// The authorization server may issue a new refresh token. If it doesn't,
// we should re-use the one we already have.
if (credentials.refreshToken != null) return credentials;
« no previous file with comments | « pkg/oauth2/lib/src/client.dart ('k') | pkg/oauth2/lib/src/handle_access_token_response.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698