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

Unified Diff: utils/pub/oauth2.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 | « utils/pub/log.dart ('k') | utils/pub/package.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/oauth2.dart
diff --git a/utils/pub/oauth2.dart b/utils/pub/oauth2.dart
index 378614b30846f51ec7bd682bf4db09ef708e6d95..786ff35ee6e0cb3bce04e943c9b1ef44d20fea96 100644
--- a/utils/pub/oauth2.dart
+++ b/utils/pub/oauth2.dart
@@ -108,7 +108,7 @@ Future<Client> _getClient(SystemCache cache) {
return new Future.immediate(new Client(
_identifier, _secret, credentials, httpClient: curlClient));
}).chain((client) {
- return _saveCredentials(cache, client.credentials).transform((_) => client);
+ return _saveCredentials(cache, client.credentials).then((_) => client);
});
}
@@ -130,7 +130,7 @@ Future<Credentials> _loadCredentials(SystemCache cache) {
return new Future.immediate(null);
}
- return readTextFile(_credentialsFile(cache)).transform((credentialsJson) {
+ return readTextFile(_credentialsFile(cache)).then((credentialsJson) {
var credentials = new Credentials.fromJson(credentialsJson);
if (credentials.isExpired && !credentials.canRefresh) {
log.error("Pub's authorization to upload packages has expired and "
@@ -194,7 +194,7 @@ Future<Client> _authorize() {
response.headers.set('location', 'http://pub.dartlang.org/authorized');
response.outputStream.close();
return grant.handleAuthorizationResponse(queryToMap(queryString));
- }).transform((client) {
+ }).then((client) {
server.close();
return client;
}), completer);
@@ -210,7 +210,7 @@ Future<Client> _authorize() {
'Then click "Allow access".\n\n'
'Waiting for your authorization...');
- return completer.future.transform((client) {
+ return completer.future.then((client) {
log.message('Successfully authorized.\n');
return client;
});
« no previous file with comments | « utils/pub/log.dart ('k') | utils/pub/package.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698