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

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

Issue 1028683004: Added better error and OAuth support in xhr.js. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/app_remoting_webapp_files.gypi ('k') | remoting/webapp/crd/js/host_list_api_impl.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/dns_blackhole_checker.js
diff --git a/remoting/webapp/crd/js/dns_blackhole_checker.js b/remoting/webapp/crd/js/dns_blackhole_checker.js
index 95b342c6aa112410263de0dbdb9e756a386de9ac..77f588c2a10a8909f6e8c99d975cc19b6a094fc8 100644
--- a/remoting/webapp/crd/js/dns_blackhole_checker.js
+++ b/remoting/webapp/crd/js/dns_blackhole_checker.js
@@ -110,10 +110,7 @@ remoting.DnsBlackholeChecker.prototype.getJid = function() {
};
remoting.DnsBlackholeChecker.prototype.dispose = function() {
- if (this.xhr_) {
- this.xhr_.abort();
- this.xhr_ = null;
- }
+ this.xhr_ = null;
base.dispose(this.signalStrategy_);
this.setState_(remoting.SignalStrategy.State.CLOSED);
};
@@ -157,6 +154,12 @@ remoting.DnsBlackholeChecker.prototype.onWrappedSignalStrategyStateChanged_ =
* @private
*/
remoting.DnsBlackholeChecker.prototype.onHttpRequestDone_ = function(response) {
+ if (this.xhr_ == null) {
+ // This happens when the dispose() method is called while a
+ // request is pending.
+ return;
+ }
+
this.xhr_ = null;
if (response.status >= 200 && response.status <= 299) {
console.log("DNS blackhole check succeeded.");
« no previous file with comments | « remoting/app_remoting_webapp_files.gypi ('k') | remoting/webapp/crd/js/host_list_api_impl.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698