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: Small update Created Nov. 3, 2018, 9:34 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
@@ -135,16 +135,19 @@
* if necessary.
* @param {Filter} filter filter that has been added
*/
function addFilter(filter)
{
if (!(filter instanceof ActiveFilter) || filter.disabled)
return;
+ if (!filter.subscriptionsAdded)
+ filterStorage.addSubscriptionsToFilter(filter);
+
let hasEnabled = false;
let allowSnippets = false;
for (let subscription of filter.subscriptions())
{
if (!subscription.disabled)
{
hasEnabled = true;
@@ -184,16 +187,19 @@
*/
function removeFilter(filter)
{
if (!(filter instanceof ActiveFilter))
return;
if (!filter.disabled)
{
+ if (!filter.subscriptionsAdded)
+ filterStorage.addSubscriptionsToFilter(filter);
+
let hasEnabled = false;
for (let subscription of filter.subscriptions())
{
if (!subscription.disabled)
{
hasEnabled = true;
break;
}

Powered by Google App Engine
This is Rietveld