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

Unified Diff: libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java

Issue 29556582: Issue 5643 - Make v8::Isolate injectable into JsEngine (Closed)
Patch Set: reverted not related changes, addressed sergei's comments Created Sept. 26, 2017, 11:15 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java
index f7d2ec6e40ff4e783aeda8515d9c0337fc1953a6..a600b9d1d4028233ecb0165a2f36d9c08df6aa8b 100644
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java
@@ -133,6 +133,7 @@ public final class AdblockEngine
private AppInfo appInfo;
private String basePath;
private IsAllowedConnectionCallback isAllowedConnectionCallback;
+ private Long v8IsolatePtr;
private AdblockEngine engine;
@@ -169,6 +170,12 @@ public final class AdblockEngine
return this;
}
+ public Builder useV8Isolate(long v8IsolatePtr)
+ {
+ this.v8IsolatePtr = v8IsolatePtr;
+ return this;
+ }
+
public Builder setUpdateAvailableCallback(UpdateAvailableCallback callback)
{
engine.updateAvailableCallback = callback;
@@ -255,7 +262,14 @@ public final class AdblockEngine
{
engine.logSystem = new AndroidLogSystem();
engine.platform = new Platform(engine.logSystem, engine.webRequest, basePath);
- engine.platform.setUpJsEngine(appInfo);
+ if (v8IsolatePtr != null)
+ {
+ engine.platform.setUpJsEngine(appInfo, v8IsolatePtr);
+ }
+ else
+ {
+ engine.platform.setUpJsEngine(appInfo);
+ }
engine.platform.setUpFilterEngine(isAllowedConnectionCallback);
engine.filterEngine = engine.platform.getFilterEngine();
}

Powered by Google App Engine
This is Rietveld