Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/firefoxDataCleanup.js

Issue 29907589: Issue 7054 - Update the adblockpluscore dependency to 5cb695da5a40, adblockplusui to f86abf2efdfd (Closed)
Patch Set: Address PS12 Comment Created Jan. 8, 2019, 1:02 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/filterComposer.js ('k') | lib/hitLogger.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/firefoxDataCleanup.js
===================================================================
--- a/lib/firefoxDataCleanup.js
+++ b/lib/firefoxDataCleanup.js
@@ -14,27 +14,27 @@
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
"use strict";
const {Filter, ActiveFilter} = require("../adblockpluscore/lib/filterClasses");
const {filterNotifier} = require("../adblockpluscore/lib/filterNotifier");
-const {FilterStorage} = require("../adblockpluscore/lib/filterStorage");
+const {filterStorage} = require("../adblockpluscore/lib/filterStorage");
const {Prefs} = require("./prefs");
const {SpecialSubscription} =
require("../adblockpluscore/lib/subscriptionClasses");
Promise.all([filterNotifier.once("load"), Prefs.untilLoaded]).then(() =>
{
if (Prefs.data_cleanup_done)
return;
- if (FilterStorage.firstRun)
+ if (filterStorage.firstRun)
{
Prefs.data_cleanup_done = true;
return;
}
let haveHitCounts = [];
for (let key in Filter.knownFilters)
@@ -49,34 +49,34 @@
filter.disabled = false;
for (let subscription of filter.subscriptions())
{
if (subscription instanceof SpecialSubscription)
{
while (true)
{
- let position = subscription.filters.indexOf(filter);
+ let position = subscription.searchFilter(filter);
if (position < 0)
break;
let newFilter = Filter.fromText("! " + filter.text);
- FilterStorage.removeFilter(filter, subscription, position);
- FilterStorage.addFilter(newFilter, subscription, position);
+ filterStorage.removeFilter(filter, subscription, position);
+ filterStorage.addFilter(newFilter, subscription, position);
}
}
}
}
if (filter.hitCount || filter.lastHit)
haveHitCounts.push(filter);
}
// Reset hit statistics on any filters having them
- FilterStorage.resetHitCounts(haveHitCounts);
+ filterStorage.resetHitCounts(haveHitCounts);
// Remove any existing automatic backups
let backups = [];
for (let i = 1; i < 100; i++)
backups.push(`file:patterns-backup${i}.ini`);
browser.storage.local.remove(backups, () =>
{
Prefs.data_cleanup_done = true;
« no previous file with comments | « lib/filterComposer.js ('k') | lib/hitLogger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld