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

Delta Between Two Patch Sets: adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/engine/Subscriptions.java

Issue 29524668: Issue 3916 - Supporting Adding filter lists via URL (Closed)
Left Patch Set: Issue 3916 - Supporting Adding filer lists via URL Created Aug. 23, 2017, 2:20 p.m.
Right Patch Set: Use TAG constant for log, fix in MoreBlockingPreferenceCategory Created Oct. 10, 2017, 1:57 p.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 | « adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/engine/Engine.java ('k') | no next file » | 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 if (!this.subscriptions.containsKey(id)) 215 if (!this.subscriptions.containsKey(id))
216 { 216 {
217 this.subscriptions.put(id, sub); 217 this.subscriptions.put(id, sub);
218 return sub; 218 return sub;
219 } 219 }
220 return this.subscriptions.get(id); 220 return this.subscriptions.get(id);
221 } 221 }
222 222
223 public boolean remove(final String id) 223 public boolean remove(final String id)
224 { 224 {
225 if (this.subscriptions.containsKey(id)) 225 return this.subscriptions.remove(id) != null;
anton 2017/08/25 10:40:40 the whole method could be replaced with `return th
jens 2017/08/25 11:35:07 Acknowledged. The return values is not needed yet
226 {
227 this.subscriptions.remove(id);
228 return true;
229 }
230 return false;
231 } 226 }
232 227
233 public static Subscriptions initialize(final Engine engine, final File appFold er, 228 public static Subscriptions initialize(final Engine engine, final File appFold er,
234 final File cacheFolder) 229 final File cacheFolder)
235 { 230 {
236 final Subscriptions subs = new Subscriptions(engine, appFolder, cacheFolder) ; 231 final Subscriptions subs = new Subscriptions(engine, appFolder, cacheFolder) ;
237 232
238 subs.subscriptionFolder.mkdirs(); 233 subs.subscriptionFolder.mkdirs();
239 subs.cacheFolder.mkdirs(); 234 subs.cacheFolder.mkdirs();
240 235
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 if (sub != null) 289 if (sub != null)
295 { 290 {
296 if (sub.updateSubscription(responseCode, text, httpHeaders, this.getMetaFi le(sub), 291 if (sub.updateSubscription(responseCode, text, httpHeaders, this.getMetaFi le(sub),
297 this.getFiltersFile(sub))) 292 this.getFiltersFile(sub)))
298 { 293 {
299 this.engine.requestUpdateBroadcast(); 294 this.engine.requestUpdateBroadcast();
300 } 295 }
301 } 296 }
302 } 297 }
303 } 298 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld