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

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: 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/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 9516e3ca45ea59134dddea265224fa5c15943649..7f630f20daf896a986eacc1eec5865352b265387 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));
};
/**

Powered by Google App Engine
This is Rietveld 408576698