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

Unified Diff: lib/filterStorage.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: Created Nov. 3, 2018, 9:19 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
« lib/filterListener.js ('K') | « lib/filterListener.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterStorage.js
===================================================================
--- a/lib/filterStorage.js
+++ b/lib/filterStorage.js
@@ -123,16 +123,31 @@
* @type {number}
*/
get subscriptionCount()
{
return this.knownSubscriptions.size;
}
/**
+ * Adds any subscriptions to which a filter belongs to the filter.
+ * @param {Filter} filter
+ */
+ addSubscriptionsToFilter(filter)
+ {
+ for (let subscription of this.subscriptions())
+ {
+ if (subscription.filters.indexOf(filter) != -1)
Manish Jethani 2018/11/03 21:31:25 This is super inefficient, but currently it is not
+ filter.addSubscription(subscription);
+ }
+
+ filter.subscriptionsAssigned = true;
+ }
+
+ /**
* Finds the filter group that a filter should be added to by default. Will
* return <code>null</code> if this group doesn't exist yet.
* @param {Filter} filter
* @returns {?SpecialSubscription}
*/
getGroupForFilter(filter)
{
let generalSubscription = null;
« lib/filterListener.js ('K') | « lib/filterListener.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld