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

Delta Between Two Patch Sets: lib/firefoxDataCleanup.js

Issue 29907589: Issue 7054 - Update the adblockpluscore dependency to 5cb695da5a40, adblockplusui to f86abf2efdfd (Closed)
Left Patch Set: Add all the changes Created Nov. 29, 2018, 5:29 p.m.
Right Patch Set: Address PS12 Comment Created Jan. 8, 2019, 1:02 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 | « lib/filterComposer.js ('k') | lib/hitLogger.js » ('j') | no next file with change/comment »
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 { 47 {
48 // Enable or replace disabled filters 48 // Enable or replace disabled filters
49 filter.disabled = false; 49 filter.disabled = false;
50 50
51 for (let subscription of filter.subscriptions()) 51 for (let subscription of filter.subscriptions())
52 { 52 {
53 if (subscription instanceof SpecialSubscription) 53 if (subscription instanceof SpecialSubscription)
54 { 54 {
55 while (true) 55 while (true)
56 { 56 {
57 let position = subscription.filters.indexOf(filter); 57 let position = subscription.searchFilter(filter);
58 if (position < 0) 58 if (position < 0)
59 break; 59 break;
60 60
61 let newFilter = Filter.fromText("! " + filter.text); 61 let newFilter = Filter.fromText("! " + filter.text);
62 filterStorage.removeFilter(filter, subscription, position); 62 filterStorage.removeFilter(filter, subscription, position);
63 filterStorage.addFilter(newFilter, subscription, position); 63 filterStorage.addFilter(newFilter, subscription, position);
64 } 64 }
65 } 65 }
66 } 66 }
67 } 67 }
68 68
69 if (filter.hitCount || filter.lastHit) 69 if (filter.hitCount || filter.lastHit)
70 haveHitCounts.push(filter); 70 haveHitCounts.push(filter);
71 } 71 }
72 72
73 // Reset hit statistics on any filters having them 73 // Reset hit statistics on any filters having them
74 filterStorage.resetHitCounts(haveHitCounts); 74 filterStorage.resetHitCounts(haveHitCounts);
75 75
76 // Remove any existing automatic backups 76 // Remove any existing automatic backups
77 let backups = []; 77 let backups = [];
78 for (let i = 1; i < 100; i++) 78 for (let i = 1; i < 100; i++)
79 backups.push(`file:patterns-backup${i}.ini`); 79 backups.push(`file:patterns-backup${i}.ini`);
80 browser.storage.local.remove(backups, () => 80 browser.storage.local.remove(backups, () =>
81 { 81 {
82 Prefs.data_cleanup_done = true; 82 Prefs.data_cleanup_done = true;
83 }); 83 });
84 }); 84 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld