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

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

Issue 29536629: Issue 5556 - Update to use libadblockplus revision hg:566f64c8a2a8 (Closed) Base URL: github.com:abby-sergz/libadblockplus-android.git
Patch Set: address comments Created Sept. 8, 2017, 9:39 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/JsEngine.java
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/JsEngine.java b/libadblockplus-android/src/org/adblockplus/libadblockplus/JsEngine.java
index f122c7142e2401d73202d99572058a087ccd728c..331a7ac7dfb5f0ad91c2938ef154d43af0b9b3a8 100644
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/JsEngine.java
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/JsEngine.java
@@ -19,9 +19,8 @@ package org.adblockplus.libadblockplus;
import java.util.List;
-public final class JsEngine implements Disposable
+public final class JsEngine
{
- private final Disposer disposer;
protected final long ptr;
static
@@ -30,20 +29,9 @@ public final class JsEngine implements Disposable
registerNatives();
}
- public JsEngine(final AppInfo appInfo, final LogSystem logSystem, final WebRequest webRequest, final String basePath)
- {
- this(ctor(appInfo, logSystem, webRequest, basePath));
- }
-
- public JsEngine(final AppInfo appInfo)
- {
- this(appInfo, null, null, null);
- }
-
- protected JsEngine(final long ptr)
+ JsEngine(final long ptr)
{
this.ptr = ptr;
- this.disposer = new Disposer(this, new DisposeWrapper(ptr));
}
public void setEventCallback(final String eventName, final EventCallback callback)
@@ -98,33 +86,8 @@ public final class JsEngine implements Disposable
return newValue(this.ptr, value);
}
- @Override
- public void dispose()
- {
- this.disposer.dispose();
- }
-
- private final static class DisposeWrapper implements Disposable
- {
- private final long ptr;
-
- public DisposeWrapper(final long ptr)
- {
- this.ptr = ptr;
- }
-
- @Override
- public void dispose()
- {
- dtor(this.ptr);
- }
- }
-
private final static native void registerNatives();
- private final static native long ctor(AppInfo appInfo, LogSystem logSystem, WebRequest webRequest,
- String basePath);
-
private final static native void setEventCallback(long ptr, String eventName, long callback);
private final static native void removeEventCallback(long ptr, String eventName);
@@ -138,6 +101,4 @@ public final class JsEngine implements Disposable
private final static native JsValue newValue(long ptr, boolean value);
private final static native JsValue newValue(long ptr, String value);
-
- private final static native void dtor(long ptr);
}

Powered by Google App Engine
This is Rietveld