Bug 1272239 - Part 1: Support completion for test database. r=francois
authordimi <dlee@mozilla.com>
Thu, 21 Jul 2016 15:35:36 +0800
changeset 348492 74de16c8bed76a4c7885bb6a51c4933aac09029e
parent 348491 400da2ae93a1cad8ce9c6ce8bd329b290b453fc8
child 348493 cfe1ca72b7d7ac25016da955cbc9fc259b971226
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrancois
bugs1272239
milestone50.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 1272239 - Part 1: Support completion for test database. r=francois MozReview-Commit-ID: 85BALQHKSal
toolkit/components/url-classifier/SafeBrowsing.jsm
toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
--- a/toolkit/components/url-classifier/SafeBrowsing.jsm
+++ b/toolkit/components/url-classifier/SafeBrowsing.jsm
@@ -22,32 +22,29 @@ function log(...stuff) {
     return;
   }
 
   var d = new Date();
   let msg = "SafeBrowsing: " + d.toTimeString() + ": " + stuff.join(" ");
   dump(Services.urlFormatter.trimSensitiveURLs(msg) + "\n");
 }
 
-// Skip all the ones containining "test", because we never need to ask for
-// updates for them.
 function getLists(prefName) {
   log("getLists: " + prefName);
   let pref = null;
   try {
     pref = Services.prefs.getCharPref(prefName);
   } catch(e) {
     return null;
   }
   // Splitting an empty string returns [''], we really want an empty array.
   if (!pref) {
     return [];
   }
   return pref.split(",")
-    .filter(function(value) { return value.indexOf("test-") == -1; })
     .map(function(value) { return value.trim(); });
 }
 
 const tablePreferences = [
   "urlclassifier.phishTable",
   "urlclassifier.malwareTable",
   "urlclassifier.downloadBlockTable",
   "urlclassifier.downloadAllowTable",
--- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
@@ -1596,19 +1596,16 @@ nsUrlClassifierDBService::GetCompleter(c
 
   // If we don't know about this table at all, or are disallowing completions
   // for it, skip completion checks.
   if (!mGethashTables.Contains(tableName) ||
       mDisallowCompletionsTables.Contains(tableName)) {
     return false;
   }
 
-  MOZ_ASSERT(!StringBeginsWith(tableName, NS_LITERAL_CSTRING("test-")),
-             "We should never fetch hash completions for test tables");
-
   // Otherwise, call gethash to find the hash completions.
   return NS_SUCCEEDED(CallGetService(NS_URLCLASSIFIERHASHCOMPLETER_CONTRACTID,
                                      completer));
 }
 
 NS_IMETHODIMP
 nsUrlClassifierDBService::Observe(nsISupports *aSubject, const char *aTopic,
                                   const char16_t *aData)