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

Unified Diff: utils/pub/oauth2.dart

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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: utils/pub/oauth2.dart
diff --git a/utils/pub/oauth2.dart b/utils/pub/oauth2.dart
index 85bfed719328f178cef6ccd3d44aef196c43c0a2..9f2843ba0d4b4a06d3e3af03eee7bcb2089eec69 100644
--- a/utils/pub/oauth2.dart
+++ b/utils/pub/oauth2.dart
@@ -104,7 +104,7 @@ Future withClient(SystemCache cache, Future fn(Client client)) {
/// Gets a new OAuth2 client. If saved credentials are available, those are
/// used; otherwise, the user is prompted to authorize the pub client.
Future<Client> _getClient(SystemCache cache) {
- return new Future.of(() {
+ return new Future.sync(() {
var credentials = _loadCredentials(cache);
if (credentials == null) return _authorize();

Powered by Google App Engine
This is Rietveld 408576698