Bug 1431192 - Only fetch download protection lists when Safe Browsing is enabled. r=gcp

Download protection requires both the malware list as well as its
own special lists. The code therefore checks that both Safe
Browsing and download protection are enabled before checking
downloaded files.

The list manager should check the same prefs before downloading
any of the download protection lists in order to avoid connecting
to the Safe Browsing server when Safe Browsing is fully disabled.

MozReview-Commit-ID: 66vMA56T4pJ

--HG--
extra : rebase_source : cef14cf5a03290bd10d8d02367709e1ffd5e9030
This commit is contained in:
Francois Marier 2018-01-29 15:16:54 -08:00
Родитель 21fb2aec25
Коммит e6be1157ca
1 изменённых файлов: 2 добавлений и 2 удалений

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

@ -405,14 +405,14 @@ this.SafeBrowsing = {
}
}
for (let i = 0; i < this.downloadBlockLists.length; ++i) {
if (this.downloadsEnabled) {
if (this.malwareEnabled && this.downloadsEnabled) {
listManager.enableUpdate(this.downloadBlockLists[i]);
} else {
listManager.disableUpdate(this.downloadBlockLists[i]);
}
}
for (let i = 0; i < this.downloadAllowLists.length; ++i) {
if (this.downloadsEnabled) {
if (this.malwareEnabled && this.downloadsEnabled) {
listManager.enableUpdate(this.downloadAllowLists[i]);
} else {
listManager.disableUpdate(this.downloadAllowLists[i]);