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

Unified Diff: lib/filterListener.js

Issue 29935564: Issue 7452 - Do not cache element hiding filter objects by default Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rebase on GitLab MR #24 Created April 7, 2019, 6:08 p.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
Index: lib/filterListener.js
===================================================================
--- a/lib/filterListener.js
+++ b/lib/filterListener.js
@@ -217,62 +217,62 @@
function onSubscriptionAdded(subscription)
{
FilterListener.setDirty(1);
if (!subscription.disabled)
{
for (let text of subscription.filterText())
- addFilter(Filter.fromText(text), [subscription]);
+ addFilter(Filter.fromText(text, false), [subscription]);
}
}
function onSubscriptionRemoved(subscription)
{
FilterListener.setDirty(1);
if (!subscription.disabled)
{
for (let text of subscription.filterText())
- removeFilter(Filter.fromText(text));
+ removeFilter(Filter.fromText(text, false));
}
}
function onSubscriptionDisabled(subscription, newValue)
{
FilterListener.setDirty(1);
if (filterStorage.knownSubscriptions.has(subscription.url))
{
if (newValue == false)
{
for (let text of subscription.filterText())
- addFilter(Filter.fromText(text), [subscription]);
+ addFilter(Filter.fromText(text, false), [subscription]);
}
else
{
for (let text of subscription.filterText())
- removeFilter(Filter.fromText(text));
+ removeFilter(Filter.fromText(text, false));
}
}
}
function onSubscriptionUpdated(subscription, oldFilterText)
{
FilterListener.setDirty(1);
if (!subscription.disabled &&
filterStorage.knownSubscriptions.has(subscription.url))
{
for (let text of oldFilterText)
- removeFilter(Filter.fromText(text));
+ removeFilter(Filter.fromText(text, false));
for (let text of subscription.filterText())
- addFilter(Filter.fromText(text), [subscription]);
+ addFilter(Filter.fromText(text, false), [subscription]);
}
}
function onFilterHitCount(filter, newValue)
{
if (newValue == 0)
FilterListener.setDirty(0);
else
@@ -325,17 +325,17 @@
ElemHideExceptions.clear();
snippets.clear();
for (let subscription of filterStorage.subscriptions())
{
if (!subscription.disabled)
{
for (let text of subscription.filterText())
- addFilter(Filter.fromText(text), [subscription]);
+ addFilter(Filter.fromText(text, false), [subscription]);
}
}
}
function onSave()
{
isDirty = 0;
}
« lib/filterClasses.js ('K') | « lib/filterClasses.js ('k') | test/filterListener.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld