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

Side by Side Diff: lib/filterStorage.js

Issue 29854572: Issue 6857 - Do not serialize empty special subscriptions (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Aug. 12, 2018, 10:28 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/filterStorage_readwrite.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 }); 462 });
463 }, 463 },
464 464
465 /** 465 /**
466 * Generator serializing filter data and yielding it line by line. 466 * Generator serializing filter data and yielding it line by line.
467 */ 467 */
468 *exportData() 468 *exportData()
469 { 469 {
470 // Do not persist external subscriptions 470 // Do not persist external subscriptions
471 let subscriptions = this.subscriptions.filter( 471 let subscriptions = this.subscriptions.filter(
472 s => !(s instanceof ExternalSubscription) 472 s => !(s instanceof ExternalSubscription) &&
473 !(s instanceof SpecialSubscription && s.filters.length == 0)
473 ); 474 );
474 475
475 yield "# Adblock Plus preferences"; 476 yield "# Adblock Plus preferences";
476 yield "version=" + formatVersion; 477 yield "version=" + formatVersion;
477 478
478 let saved = new Set(); 479 let saved = new Set();
479 let buf = []; 480 let buf = [];
480 481
481 // Save subscriptions 482 // Save subscriptions
482 for (let subscription of subscriptions) 483 for (let subscription of subscriptions)
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 else if (this.wantObj === false && val) 774 else if (this.wantObj === false && val)
774 this.curObj.push(val.replace(/\\\[/g, "[")); 775 this.curObj.push(val.replace(/\\\[/g, "["));
775 } 776 }
776 finally 777 finally
777 { 778 {
778 Filter.knownFilters = origKnownFilters; 779 Filter.knownFilters = origKnownFilters;
779 Subscription.knownSubscriptions = origKnownSubscriptions; 780 Subscription.knownSubscriptions = origKnownSubscriptions;
780 } 781 }
781 } 782 }
782 }; 783 };
OLDNEW
« no previous file with comments | « no previous file | test/filterStorage_readwrite.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld