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

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: fixed bad merge 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
« no previous file with comments | « remoting/webapp/crd/js/apps_v2_migration.js ('k') | remoting/webapp/crd/js/crd_event_handlers.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 511d7c39eab0e02b224788005be6418e4fae8ae0..dc2a2a9ccf96949f794959a288869591d9753092 100644
--- a/remoting/webapp/crd/js/client_session.js
+++ b/remoting/webapp/crd/js/client_session.js
@@ -778,8 +778,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);
};
« no previous file with comments | « remoting/webapp/crd/js/apps_v2_migration.js ('k') | remoting/webapp/crd/js/crd_event_handlers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698