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

Delta Between Two Patch Sets: lib/filterListener.js

Issue 29800557: Issue 6559 - Use Map object for known subscriptions (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created June 6, 2018, 10:50 a.m.
Right Patch Set: Move check for known subscription into removeSubscription Created June 6, 2018, 11 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | lib/filterStorage.js » ('j') | lib/filterStorage.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 addFilters(subscription.filters); 247 addFilters(subscription.filters);
248 else 248 else
249 subscription.filters.forEach(removeFilter); 249 subscription.filters.forEach(removeFilter);
250 } 250 }
251 } 251 }
252 252
253 function onSubscriptionUpdated(subscription) 253 function onSubscriptionUpdated(subscription)
254 { 254 {
255 FilterListener.setDirty(1); 255 FilterListener.setDirty(1);
256 256
257 if (FilterStorage.knownSubscriptions.has(subscription.url) && 257 if (!subscription.disabled &&
Manish Jethani 2018/06/06 11:04:42 Better to check if the subscription is disabled fi
kzar 2018/06/07 13:52:26 Acknowledged.
258 !subscription.disabled) 258 FilterStorage.knownSubscriptions.has(subscription.url))
259 { 259 {
260 subscription.oldFilters.forEach(removeFilter); 260 subscription.oldFilters.forEach(removeFilter);
261 addFilters(subscription.filters); 261 addFilters(subscription.filters);
262 } 262 }
263 } 263 }
264 264
265 function onFilterHitCount(filter, newValue) 265 function onFilterHitCount(filter, newValue)
266 { 266 {
267 if (newValue == 0) 267 if (newValue == 0)
268 FilterListener.setDirty(0); 268 FilterListener.setDirty(0);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 { 317 {
318 if (!subscription.disabled) 318 if (!subscription.disabled)
319 addFilters(subscription.filters); 319 addFilters(subscription.filters);
320 } 320 }
321 } 321 }
322 322
323 function onSave() 323 function onSave()
324 { 324 {
325 isDirty = 0; 325 isDirty = 0;
326 } 326 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld