Bug 1431192 - Only fetch download protection lists when Safe Browsing is enabled. r?gcp draft
authorFrancois Marier <francois@mozilla.com>
Mon, 29 Jan 2018 15:16:54 -0800
changeset 748528 ec1d277f515a2e87079eb58665eed43431a5844a
parent 748403 117e0c0d1ebe2cf5bdffc3474744add2416fc511
push id97202
push userfmarier@mozilla.com
push dateMon, 29 Jan 2018 23:46:38 +0000
reviewersgcp
bugs1431192
milestone60.0a1
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
toolkit/components/url-classifier/SafeBrowsing.jsm
--- a/toolkit/components/url-classifier/SafeBrowsing.jsm
+++ b/toolkit/components/url-classifier/SafeBrowsing.jsm
@@ -400,24 +400,24 @@ this.SafeBrowsing = {
     for (let i = 0; i < this.malwareLists.length; ++i) {
       if (this.malwareEnabled) {
         listManager.enableUpdate(this.malwareLists[i]);
       } else {
         listManager.disableUpdate(this.malwareLists[i]);
       }
     }
     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]);
       }
     }
     for (let i = 0; i < this.passwordAllowLists.length; ++i) {
       if (this.passwordsEnabled) {
         listManager.enableUpdate(this.passwordAllowLists[i]);