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 324866 76b7a868d3a1879b58e44ac6e40856fe497d19f6
parent 324865 9ed7aed4f033d79645dda143896bd26325e95094
child 324867 766c351e817226d1f8bbd00565ad4d54955d25b8
push id84525
push userphilringnalda@gmail.com
push dateThu, 01 Dec 2016 03:22:09 +0000
treeherdermozilla-inbound@b1d875f4c673 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp
bugs1315387
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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)) {