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

Unified Diff: remoting/webapp/app_remoting/js/feedback_consent.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
« no previous file with comments | « remoting/webapp/app_remoting/js/app_remoting.js ('k') | remoting/webapp/crd/js/dns_blackhole_checker.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/app_remoting/js/feedback_consent.js
diff --git a/remoting/webapp/app_remoting/js/feedback_consent.js b/remoting/webapp/app_remoting/js/feedback_consent.js
index f79237630c190d6e669de31ffa27090eca7046ad..1437d057c1a8b7ecd0898c58ca79edb7dfcc1427 100644
--- a/remoting/webapp/app_remoting/js/feedback_consent.js
+++ b/remoting/webapp/app_remoting/js/feedback_consent.js
@@ -127,21 +127,19 @@ function onToken(token) {
'/applications/' + remoting.settings.getAppRemotingApplicationId() +
'/hosts/' + hostId +
'/reportIssue';
- /** @param {XMLHttpRequest} xhr */
- var onDone = function(xhr) {
- if (xhr.status >= 200 && xhr.status < 300) {
+ var onDone = function(/** !remoting.Xhr.Response */ response) {
+ if (response.status >= 200 && response.status < 300) {
getUserInfo();
} else {
showError();
}
};
- remoting.xhr.start({
+ new remoting.Xhr({
method: 'POST',
url: uri,
- onDone: onDone,
jsonContent: body,
oauthToken: token
- });
+ }).start().then(onDone);
} else {
getUserInfo();
}
« no previous file with comments | « remoting/webapp/app_remoting/js/app_remoting.js ('k') | remoting/webapp/crd/js/dns_blackhole_checker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698