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 29556582: Issue 5643 - Make v8::Isolate injectable into JsEngine (Closed)
Left Patch Set: Created Sept. 26, 2017, 8:54 a.m.
Right Patch Set: Using JniLongToTypePtr for casting Created Sept. 28, 2017, 8:55 a.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/Platform.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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 */ 126 */
127 public static class Builder 127 public static class Builder
128 { 128 {
129 private Context context; 129 private Context context;
130 private Map<String, Integer> urlToResourceIdMap; 130 private Map<String, Integer> urlToResourceIdMap;
131 private AndroidWebRequestResourceWrapper.Storage resourceStorage; 131 private AndroidWebRequestResourceWrapper.Storage resourceStorage;
132 private AndroidWebRequest androidWebRequest; 132 private AndroidWebRequest androidWebRequest;
133 private AppInfo appInfo; 133 private AppInfo appInfo;
134 private String basePath; 134 private String basePath;
135 private IsAllowedConnectionCallback isAllowedConnectionCallback; 135 private IsAllowedConnectionCallback isAllowedConnectionCallback;
136 private Long v8IsolatePtr; 136 private Long v8IsolatePtr;
sergei 2017/09/28 09:34:49 I'm not sure about Long vs long here, but it seems
137 137
138 private AdblockEngine engine; 138 private AdblockEngine engine;
139 139
140 protected Builder(final AppInfo appInfo, final String basePath) 140 protected Builder(final AppInfo appInfo, final String basePath)
141 { 141 {
142 engine = new AdblockEngine(); 142 engine = new AdblockEngine();
143 engine.elemhideEnabled = true; 143 engine.elemhideEnabled = true;
144 144
145 // we can't create JsEngine and FilterEngine right now as it starts to dow nload subscriptions 145 // we can't create JsEngine and FilterEngine right now as it starts to dow nload subscriptions
146 // and requests (AndroidWebRequest and probbaly wrappers) are not specifie d yet 146 // and requests (AndroidWebRequest and probbaly wrappers) are not specifie d yet
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 255
256 androidWebRequest.updateSubscriptionURLs(engine.filterEngine); 256 androidWebRequest.updateSubscriptionURLs(engine.filterEngine);
257 257
258 return engine; 258 return engine;
259 } 259 }
260 260
261 private void createEngines() 261 private void createEngines()
262 { 262 {
263 engine.logSystem = new AndroidLogSystem(); 263 engine.logSystem = new AndroidLogSystem();
264 engine.platform = new Platform(engine.logSystem, engine.webRequest, basePa th); 264 engine.platform = new Platform(engine.logSystem, engine.webRequest, basePa th);
265 engine.platform.setUpJsEngine(appInfo, v8IsolatePtr); 265 if (v8IsolatePtr != null)
266 {
267 engine.platform.setUpJsEngine(appInfo, v8IsolatePtr);
268 }
269 else
270 {
271 engine.platform.setUpJsEngine(appInfo);
272 }
266 engine.platform.setUpFilterEngine(isAllowedConnectionCallback); 273 engine.platform.setUpFilterEngine(isAllowedConnectionCallback);
267 engine.filterEngine = engine.platform.getFilterEngine(); 274 engine.filterEngine = engine.platform.getFilterEngine();
268 } 275 }
269 } 276 }
270 277
271 public static Builder builder(AppInfo appInfo, String basePath) 278 public static Builder builder(AppInfo appInfo, String basePath)
272 { 279 {
273 return new Builder(appInfo, basePath); 280 return new Builder(appInfo, basePath);
274 } 281 }
275 282
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 public void setWhitelistedDomains(List<String> domains) 624 public void setWhitelistedDomains(List<String> domains)
618 { 625 {
619 this.whitelistedDomains = domains; 626 this.whitelistedDomains = domains;
620 } 627 }
621 628
622 public List<String> getWhitelistedDomains() 629 public List<String> getWhitelistedDomains()
623 { 630 {
624 return whitelistedDomains; 631 return whitelistedDomains;
625 } 632 }
626 } 633 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld