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

Unified Diff: remoting/webapp/host_controller.js

Issue 10207028: Fixed callWithToken error handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reviewer feedback. Created 8 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
« no previous file with comments | « remoting/webapp/client_screen.js ('k') | remoting/webapp/host_list.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/host_controller.js
diff --git a/remoting/webapp/host_controller.js b/remoting/webapp/host_controller.js
index b5850dbd049958928564a45d45b53ab5a3134d85..a29779e84fd6dcae7af430cc6e51ec060e78659c 100644
--- a/remoting/webapp/host_controller.js
+++ b/remoting/webapp/host_controller.js
@@ -203,9 +203,14 @@ remoting.HostController.prototype.start = function(hostPin, callback) {
* @param {string} publicKey */
function onKeyGenerated(privateKey, publicKey) {
remoting.oauth2.callWithToken(
- /** @param {string} oauthToken */
+ /** @param {string?} oauthToken */
function(oauthToken) {
- doRegisterHost(privateKey, publicKey, oauthToken);
+ if (oauthToken) {
+ doRegisterHost(privateKey, publicKey, oauthToken);
+ } else {
+ // TODO(jamiewalch): Have a more specific error code here?
+ callback(remoting.HostController.AsyncResult.FAILED);
+ }
});
};
« no previous file with comments | « remoting/webapp/client_screen.js ('k') | remoting/webapp/host_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698