Bug 1315387 - Cancel hash completer timeout timer when requests complete. r=gcp
authorFrancois Marier <francois@mozilla.com>
Thu, 24 Nov 2016 16:39:36 +1300
changeset 324876 76b7a868d3a1879b58e44ac6e40856fe497d19f6
parent 324875 9ed7aed4f033d79645dda143896bd26325e95094
child 324877 766c351e817226d1f8bbd00565ad4d54955d25b8
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersgcp
bugs1315387
milestone53.0a1
Bug 1315387 - Cancel hash completer timeout timer when requests complete. r=gcp MozReview-Commit-ID: 8cFc7YrxOoC
toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
--- a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
+++ b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
@@ -511,16 +511,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, "quit-application");
 
+    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)) {