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: @sergz Created June 14, 2017, 2:57 p.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"); 210 Log.d(TAG, "Force subscription update for intercepted URL " + url);
anton 2017/06/15 05:51:53 previously we invoked updateSubscriptions 1 time f
sergei 2017/06/16 11:12:09 OK, but why error (Log.e)?
anton 2017/06/16 11:25:12 Yes, obviously not `.e`. My bad.
219 if (this.adblockEngine.filterEngine != null) 211 if (engine.filterEngine != null)
anton 2017/06/15 05:51:53 "{" required
sergei 2017/06/16 11:12:09 Done.
220 this.adblockEngine.filterEngine.updateFiltersAsync(url); 212 {
anton 2017/06/15 05:51:53 "}" required
sergei 2017/06/16 11:12:08 Done.
213 engine.filterEngine.updateFiltersAsync(url);
214 }
221 } 215 }
222 }.init(this.engine)); 216 });
223 217
224 engine.webRequest = wrapper; 218 engine.webRequest = wrapper;
225 } 219 }
226 } 220 }
227 221
228 private void initCallbacks() 222 private void initCallbacks()
229 { 223 {
230 if (engine.updateAvailableCallback != null) 224 if (engine.updateAvailableCallback != null)
231 { 225 {
232 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
638 public void setWhitelistedDomains(List<String> domains) 632 public void setWhitelistedDomains(List<String> domains)
639 { 633 {
640 this.whitelistedDomains = domains; 634 this.whitelistedDomains = domains;
641 } 635 }
642 636
643 public List<String> getWhitelistedDomains() 637 public List<String> getWhitelistedDomains()
644 { 638 {
645 return whitelistedDomains; 639 return whitelistedDomains;
646 } 640 }
647 } 641 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld