Bug 1315387 - Cancel hash completer timeout timer when requests complete. r?gcp
MozReview-Commit-ID: 8cFc7YrxOoC
--- a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
+++ b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
@@ -509,16 +509,21 @@ HashCompleterRequest.prototype = {
onStartRequest: function HCR_onStartRequest(aRequest, aContext) {
// At this point no data is available for us and we have no reason to
// terminate the connection, so we do nothing until |onStopRequest|.
},
onStopRequest: function HCR_onStopRequest(aRequest, aContext, aStatusCode) {
Services.obs.removeObserver(this, "xpcom-shutdown");
+ if (this.timer_) {
+ this.timer_.cancel();
+ this.timer_ = null;
+ }
+
if (this._shuttingDown) {
throw Cr.NS_ERROR_ABORT;
}
// Default HTTP status to service unavailable, in case we can't retrieve
// the true status from the channel.
let httpStatus = 503;
if (Components.isSuccessCode(aStatusCode)) {