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: Rename filter* to filterText* Created April 8, 2019, 9:59 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
« no previous file with comments | « lib/filterClasses.js ('k') | test/elemHide.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « lib/filterClasses.js ('k') | test/elemHide.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld