OLD | NEW |
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 if (this._disabled) | 145 if (this._disabled) |
146 buffer.push("disabled=true"); | 146 buffer.push("disabled=true"); |
147 }, | 147 }, |
148 | 148 |
149 serializeFilters(buffer) | 149 serializeFilters(buffer) |
150 { | 150 { |
151 for (let filter of this.filters) | 151 for (let filter of this.filters) |
152 buffer.push(filter.text.replace(/\[/g, "\\[")); | 152 buffer.push(filter.text.replace(/\[/g, "\\[")); |
153 }, | 153 }, |
154 | 154 |
| 155 /** |
| 156 * Releases any internal references to the object. |
| 157 */ |
| 158 free() |
| 159 { |
| 160 Subscription.knownSubscriptions.delete(this.url); |
| 161 }, |
| 162 |
155 toString() | 163 toString() |
156 { | 164 { |
157 let buffer = []; | 165 let buffer = []; |
158 this.serialize(buffer); | 166 this.serialize(buffer); |
159 return buffer.join("\n"); | 167 return buffer.join("\n"); |
160 } | 168 } |
161 }; | 169 }; |
162 | 170 |
163 /** | 171 /** |
164 * Cache for known filter subscriptions, maps URL to subscription objects. | 172 * Cache for known filter subscriptions, maps URL to subscription objects. |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 if (this.errors) | 584 if (this.errors) |
577 buffer.push("errors=" + this.errors); | 585 buffer.push("errors=" + this.errors); |
578 if (this.version) | 586 if (this.version) |
579 buffer.push("version=" + this.version); | 587 buffer.push("version=" + this.version); |
580 if (this.requiredVersion) | 588 if (this.requiredVersion) |
581 buffer.push("requiredVersion=" + this.requiredVersion); | 589 buffer.push("requiredVersion=" + this.requiredVersion); |
582 if (this.downloadCount) | 590 if (this.downloadCount) |
583 buffer.push("downloadCount=" + this.downloadCount); | 591 buffer.push("downloadCount=" + this.downloadCount); |
584 } | 592 } |
585 }); | 593 }); |
OLD | NEW |