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 29465639: Issue 5309 - Subscriptions update causes ANR (Closed) Base URL: github.com:abby-sergz/libadblockplus-android.git
Left Patch Set: address comments@sergz Created June 16, 2017, 11:11 a.m.
Right Patch Set: rebase Created July 5, 2017, 1:47 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 | « libadblockplus-android/src/org/adblockplus/libadblockplus/FilterEngine.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-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 { 197 {
198 androidWebRequest = new AndroidWebRequest(engine.elemhideEnabled, true); 198 androidWebRequest = new AndroidWebRequest(engine.elemhideEnabled, true);
199 engine.webRequest = androidWebRequest; 199 engine.webRequest = androidWebRequest;
200 200
201 if (urlToResourceIdMap != null) 201 if (urlToResourceIdMap != null)
202 { 202 {
203 AndroidWebRequestResourceWrapper wrapper = new AndroidWebRequestResource Wrapper( 203 AndroidWebRequestResourceWrapper wrapper = new AndroidWebRequestResource Wrapper(
204 context, engine.webRequest, urlToResourceIdMap, resourceStorage); 204 context, engine.webRequest, urlToResourceIdMap, resourceStorage);
205 wrapper.setListener(new AndroidWebRequestResourceWrapper.Listener() 205 wrapper.setListener(new AndroidWebRequestResourceWrapper.Listener()
206 { 206 {
207 private AdblockEngine adblockEngine;
208
209 AndroidWebRequestResourceWrapper.Listener init(AdblockEngine adblockEn gine)
210 {
211 this.adblockEngine = adblockEngine;
212 return this;
213 }
214
215 @Override 207 @Override
216 public void onIntercepted(String url, int resourceId) 208 public void onIntercepted(String url, int resourceId)
217 { 209 {
218 Log.d(TAG, "Force subscription update for intercepted URL " + url); 210 Log.d(TAG, "Force subscription update for intercepted URL " + url);
219 if (this.adblockEngine.filterEngine != null) 211 if (engine.filterEngine != null)
220 { 212 {
221 this.adblockEngine.filterEngine.updateFiltersAsync(url); 213 engine.filterEngine.updateFiltersAsync(url);
222 } 214 }
223 } 215 }
224 }.init(this.engine)); 216 });
225 217
226 engine.webRequest = wrapper; 218 engine.webRequest = wrapper;
227 } 219 }
228 } 220 }
229 221
230 private void initCallbacks() 222 private void initCallbacks()
231 { 223 {
232 if (engine.updateAvailableCallback != null) 224 if (engine.updateAvailableCallback != null)
233 { 225 {
234 engine.filterEngine.setUpdateAvailableCallback(engine.updateAvailableCal lback); 226 engine.filterEngine.setUpdateAvailableCallback(engine.updateAvailableCal lback);
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 public void setWhitelistedDomains(List<String> domains) 632 public void setWhitelistedDomains(List<String> domains)
641 { 633 {
642 this.whitelistedDomains = domains; 634 this.whitelistedDomains = domains;
643 } 635 }
644 636
645 public List<String> getWhitelistedDomains() 637 public List<String> getWhitelistedDomains()
646 { 638 {
647 return whitelistedDomains; 639 return whitelistedDomains;
648 } 640 }
649 } 641 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld