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

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

Issue 29524596: Issue 5556 - make C++ implementation of LogSystem manageable only by JsEngine (Closed) Base URL: github.com:abby-sergz/libadblockplus-android.git
Patch Set: rebase Created Aug. 24, 2017, 1:39 p.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/LogSystem.java
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/LogSystem.java b/libadblockplus-android/src/org/adblockplus/libadblockplus/LogSystem.java
index a01f3f269a78b24480b0365f81ee9335930302c4..ccc983d015a316c5976b42ceb5c8f6690d4fbb95 100644
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/LogSystem.java
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/LogSystem.java
@@ -17,55 +17,12 @@
package org.adblockplus.libadblockplus;
-public abstract class LogSystem implements Disposable
+public interface LogSystem
{
- private final Disposer disposer;
- protected final long ptr;
-
- static
- {
- System.loadLibrary("adblockplus-jni");
- registerNatives();
- }
-
- public LogSystem()
- {
- this.ptr = ctor(this);
- this.disposer = new Disposer(this, new DisposeWrapper(this.ptr));
- }
-
- public static enum LogLevel
+ enum LogLevel
{
TRACE, LOG, INFO, WARN, ERROR;
}
- public abstract void logCallback(LogLevel level, String message, String source);
-
- @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(Object callbackObject);
-
- private final static native void dtor(long ptr);
+ void logCallback(LogLevel level, String message, String source);
}

Powered by Google App Engine
This is Rietveld