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(); |
} |