Bug 1386013 - Log an error when Safe Browsing times out. r=hchang

MozReview-Commit-ID: A99ov9T7rtm

--HG--
extra : rebase_source : d7fd2e8a1ebdc3f9b1c9d1ecd7bec33c6deb27d3
This commit is contained in:
Francois Marier 2017-07-31 20:29:25 -07:00
Родитель a059b8d911
Коммит 2286e70d51
2 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -416,7 +416,7 @@ HashCompleterRequest.prototype = {
// with onStopRequest since we implement nsIStreamListener on the
// channel.
if (this._channel && this._channel.isPending()) {
log("cancelling request to " + this.gethashUrl + "\n");
log("cancelling request to " + this.gethashUrl + " (timeout)\n");
Services.telemetry.getKeyedHistogramById("URLCLASSIFIER_COMPLETE_TIMEOUT2").
add(this.telemetryProvider, 1);
this._channel.cancel(Cr.NS_BINDING_ABORTED);

Просмотреть файл

@ -977,6 +977,8 @@ nsUrlClassifierStreamUpdater::Notify(nsITimer *timer)
}
mDownloadError = true; // Trigger backoff
updateFailed = true;
MOZ_LOG(gUrlClassifierStreamUpdaterLog, mozilla::LogLevel::Error,
("Safe Browsing timed out while waiting for the update server to respond."));
mozilla::Telemetry::Accumulate(mozilla::Telemetry::URLCLASSIFIER_UPDATE_TIMEOUT,
mTelemetryProvider,
static_cast<uint8_t>(eResponseTimeout));
@ -986,6 +988,8 @@ nsUrlClassifierStreamUpdater::Notify(nsITimer *timer)
mTimeoutTimer = nullptr;
// No backoff since the connection may just be temporarily slow.
updateFailed = true;
MOZ_LOG(gUrlClassifierStreamUpdaterLog, mozilla::LogLevel::Error,
("Safe Browsing timed out while waiting for the update server to finish."));
mozilla::Telemetry::Accumulate(mozilla::Telemetry::URLCLASSIFIER_UPDATE_TIMEOUT,
mTelemetryProvider,
static_cast<uint8_t>(eDownloadTimeout));