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

Unified Diff: remoting/webapp/crd/js/host_controller.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/hangout_consent_dialog.js ('k') | remoting/webapp/crd/js/host_list_api_impl.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/host_controller.js
diff --git a/remoting/webapp/crd/js/host_controller.js b/remoting/webapp/crd/js/host_controller.js
index b5f8516b0e029f5e8d95410241cbfcd4a2625df7..832ab7471284e4cf8c57687127d676c9da2bf467 100644
--- a/remoting/webapp/crd/js/host_controller.js
+++ b/remoting/webapp/crd/js/host_controller.js
@@ -306,9 +306,10 @@ remoting.HostController.prototype.start = function(hostPin, consent, onDone,
*/
function onHostClientId(
hostName, privateKey, publicKey, hostClientId) {
- remoting.identity.callWithToken(
+ remoting.identity.getToken().then(
doRegisterHost.bind(
- null, hostName, privateKey, publicKey, hostClientId), onError);
+ null, hostName, privateKey, publicKey, hostClientId),
+ remoting.Error.handler(onError));
}
/**
@@ -323,9 +324,10 @@ remoting.HostController.prototype.start = function(hostPin, consent, onDone,
that.hostDaemonFacade_.getHostClientId(
onHostClientId.bind(null, hostName, privateKey, publicKey), onError);
} else {
- remoting.identity.callWithToken(
+ remoting.identity.getToken().then(
doRegisterHost.bind(
- null, hostName, privateKey, publicKey, null), onError);
+ null, hostName, privateKey, publicKey, null),
+ remoting.Error.handler(onError));
}
}
@@ -558,8 +560,9 @@ remoting.HostController.prototype.getClientBaseJid_ = function(
/** @param {string} token */
function connectSignalingWithToken(token) {
- remoting.identity.getEmail(
- connectSignalingWithTokenAndEmail.bind(null, token), onError);
+ remoting.identity.getEmail().then(
+ connectSignalingWithTokenAndEmail.bind(null, token),
+ remoting.Error.handler(onError));
}
/**
@@ -571,7 +574,8 @@ remoting.HostController.prototype.getClientBaseJid_ = function(
remoting.settings.XMPP_SERVER_FOR_CLIENT, email, token);
}
- remoting.identity.callWithToken(connectSignalingWithToken, onError);
+ remoting.identity.getToken().then(
+ connectSignalingWithToken, remoting.Error.handler(onError));
};
/** @type {remoting.HostController} */
« no previous file with comments | « remoting/webapp/crd/js/hangout_consent_dialog.js ('k') | remoting/webapp/crd/js/host_list_api_impl.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698