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

Unified Diff: lib/filterListener.js

Issue 29935568: Issue 7096 - Make it possible to lazy initialize a filter's subscriptions (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rebase and refactor Created Nov. 18, 2018, 12:46 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
Index: lib/filterListener.js
===================================================================
--- a/lib/filterListener.js
+++ b/lib/filterListener.js
@@ -137,17 +137,17 @@
*/
function addFilter(filter)
{
if (!(filter instanceof ActiveFilter) || filter.disabled)
return;
let hasEnabled = false;
let allowSnippets = false;
- for (let subscription of filter.subscriptions())
+ for (let subscription of filterStorage.subscriptionsForFilter(filter))
{
if (!subscription.disabled)
{
hasEnabled = true;
// Allow snippets to be executed only by the circumvention lists or the
// user's own filters.
if (subscription.type == "circumvention" ||
@@ -185,17 +185,17 @@
function removeFilter(filter)
{
if (!(filter instanceof ActiveFilter))
return;
if (!filter.disabled)
{
let hasEnabled = false;
- for (let subscription of filter.subscriptions())
+ for (let subscription of filterStorage.subscriptionsForFilter(filter))
{
if (!subscription.disabled)
{
hasEnabled = true;
break;
}
}
if (hasEnabled)
« lib/filterClasses.js ('K') | « lib/filterClasses.js ('k') | lib/filterStorage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld