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

Unified Diff: remoting/webapp/crd/js/it2me_connect_flow.js

Issue 1003433002: Updated remoting.xhr API to use promises. Removed access to the native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@spy-promise
Patch Set: Created 5 years, 9 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/it2me_connect_flow.js
diff --git a/remoting/webapp/crd/js/it2me_connect_flow.js b/remoting/webapp/crd/js/it2me_connect_flow.js
index 20f42c2c65701f73323d2795183679a21ab96474..eeef467e922ffbaad405f8eaf25e708016bbe219 100644
--- a/remoting/webapp/crd/js/it2me_connect_flow.js
+++ b/remoting/webapp/crd/js/it2me_connect_flow.js
@@ -88,20 +88,17 @@ remoting.It2MeConnectFlow.prototype.verifyAccessCode_ = function(accessCode) {
* Continues an IT2Me connection once an access token has been obtained.
*
* @param {string} token An OAuth2 access token.
- * @return {Promise<XMLHttpRequest>}
+ * @return {Promise<remoting.Xhr.Response>}
* @private
*/
remoting.It2MeConnectFlow.prototype.getHostInfo_ = function(token) {
var that = this;
- return new Promise(function(resolve) {
- remoting.xhr.start({
- method: 'GET',
- url: remoting.settings.DIRECTORY_API_BASE_URL + '/support-hosts/' +
- encodeURIComponent(that.hostId_),
- onDone: resolve,
- oauthToken: token
- });
- });
+ new remoting.Xhr({
Jamie 2015/03/16 18:06:34 Don't you need to return this?
John Williams 2015/03/16 23:15:00 Sure, if I was actually calling this method :-) P
John Williams 2015/03/16 23:16:22 Hey, wait, I removed this when I realized this was
+ method: 'GET',
+ url: remoting.settings.DIRECTORY_API_BASE_URL + '/support-hosts/' +
+ encodeURIComponent(that.hostId_),
+ oauthToken: token
+ }).start();
};
/**

Powered by Google App Engine
This is Rietveld 408576698