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

Delta Between Two Patch Sets: libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java

Issue 29389555: Issue 5010 - Allow to preload subscription files (Closed)
Left Patch Set: diego's suggestions 2 Created March 30, 2017, 10:26 a.m.
Right Patch Set: force downloading actually Created March 30, 2017, 10:12 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
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 private final Handler handler = new Handler(Looper.getMainLooper()); 241 private final Handler handler = new Handler(Looper.getMainLooper());
242 242
243 private final Runnable forceUpdateRunnable = new Runnable() 243 private final Runnable forceUpdateRunnable = new Runnable()
244 { 244 {
245 public void run() { 245 public void run() {
246 // Filter Engine can be already disposed 246 // Filter Engine can be already disposed
247 if (filterEngine != null) 247 if (filterEngine != null)
248 { 248 {
249 Log.d(TAG, "Force update subscriptions"); 249 Log.d(TAG, "Force update subscriptions");
250 filterEngine.forceUpdateCheck(updateCheckDoneCallback); 250 List<Subscription> subscriptions = filterEngine.getListedSubscriptions ();
251 for (Subscription eachSubscription : subscriptions)
sergei 2017/03/30 22:14:37 Nit: I would remove "each".
252 {
253 try
254 {
255 eachSubscription.updateFilters();
256 }
257 finally
258 {
259 eachSubscription.dispose();
260 }
261 }
251 } 262 }
252 } 263 }
253 }; 264 };
254 265
255 @Override 266 @Override
256 public void onIntercepted(String url, int resourceId) 267 public void onIntercepted(String url, int resourceId)
257 { 268 {
258 // we need to force update subscriptions ASAP after preloaded one is retur ned 269 // we need to force update subscriptions ASAP after preloaded one is retur ned
259 // but we should note that multiple interceptions (for main easylist and A A) and force update once only 270 // but we should note that multiple interceptions (for main easylist and A A) and force update once only
260 271
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 public void setWhitelistedDomains(List<String> domains) 589 public void setWhitelistedDomains(List<String> domains)
579 { 590 {
580 this.whitelistedDomains = domains; 591 this.whitelistedDomains = domains;
581 } 592 }
582 593
583 public List<String> getWhitelistedDomains() 594 public List<String> getWhitelistedDomains()
584 { 595 {
585 return whitelistedDomains; 596 return whitelistedDomains;
586 } 597 }
587 } 598 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld