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

Unified Diff: remoting/webapp/crd/js/client_session.js

Issue 937593002: Changed identity API to use promises instead of callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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: remoting/webapp/crd/js/client_session.js
diff --git a/remoting/webapp/crd/js/client_session.js b/remoting/webapp/crd/js/client_session.js
index 1f396925bc505a342fcfbe5c9e6b4b42634cc514..9ad9bc6ce1249c705d541f292ba357ab90c6af1b 100644
--- a/remoting/webapp/crd/js/client_session.js
+++ b/remoting/webapp/crd/js/client_session.js
@@ -1581,8 +1581,10 @@ remoting.ClientSession.prototype.sendGoogleDriveAccessToken_ = function() {
/** @param {remoting.Error} error */
var sendError = function(error) {
console.log('Failed to refresh access token: ' + error);
- }
- remoting.identity.callWithNewToken(sendToken, sendError);
+ };
+ remoting.identity.getNewToken().
+ then(sendToken).
+ catch(remoting.Error.handler(sendError));
window.setTimeout(this.sendGoogleDriveAccessToken_.bind(this),
remoting.ACCESS_TOKEN_RESEND_INTERVAL_MS);
};

Powered by Google App Engine
This is Rietveld 408576698