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

Unified Diff: remoting/webapp/crd/js/host_list_api_impl.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/host_controller.js ('k') | remoting/webapp/crd/js/host_screen.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/host_list_api_impl.js
diff --git a/remoting/webapp/crd/js/host_list_api_impl.js b/remoting/webapp/crd/js/host_list_api_impl.js
index 40489bda2a1f29e79b2fef5dbd5d7f427e238ad0..1e27ac5e8b4977d18a7bb9f8424618d840206624 100644
--- a/remoting/webapp/crd/js/host_list_api_impl.js
+++ b/remoting/webapp/crd/js/host_list_api_impl.js
@@ -35,7 +35,7 @@ remoting.HostListApiImpl.prototype.get = function(onDone, onError) {
remoting.xhr.get(remoting.settings.DIRECTORY_API_BASE_URL + '/@me/hosts',
parseHostListResponse, '', headers);
};
- remoting.identity.callWithToken(onToken, onError);
+ remoting.identity.getToken().then(onToken, remoting.Error.handler(onError));
};
/**
@@ -68,7 +68,7 @@ remoting.HostListApiImpl.prototype.put =
JSON.stringify(newHostDetails),
headers);
};
- remoting.identity.callWithToken(onToken, onError);
+ remoting.identity.getToken().then(onToken, remoting.Error.handler(onError));
};
/**
@@ -87,7 +87,7 @@ remoting.HostListApiImpl.prototype.remove = function(hostId, onDone, onError) {
remoting.xhr.defaultResponse(onDone, onError),
'', headers);
};
- remoting.identity.callWithToken(onToken, onError);
+ remoting.identity.getToken().then(onToken, remoting.Error.handler(onError));
};
/**
« no previous file with comments | « remoting/webapp/crd/js/host_controller.js ('k') | remoting/webapp/crd/js/host_screen.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698