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

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

Issue 29526710: Issue 5556 - make C++ implementation of WebRequest manageable only by JsEngine (Closed) Base URL: github.com:abby-sergz/libadblockplus-android.git
Patch Set: Created Aug. 24, 2017, 5:26 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/WebRequest.java
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/WebRequest.java b/libadblockplus-android/src/org/adblockplus/libadblockplus/WebRequest.java
index c5e83998d0d4cfbc35dbf704988fbc940960afbf..35f43f58235984a73851a3ad928b366642d48ffa 100644
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/WebRequest.java
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/WebRequest.java
@@ -19,50 +19,7 @@ package org.adblockplus.libadblockplus;
import java.util.List;
-public abstract class WebRequest implements Disposable
+public interface WebRequest
{
- private final Disposer disposer;
- protected final long ptr;
-
- static
- {
- System.loadLibrary("adblockplus-jni");
- registerNatives();
- }
-
- public WebRequest()
- {
- this.ptr = ctor(this);
- this.disposer = new Disposer(this, new DisposeWrapper(this.ptr));
- }
-
- public abstract ServerResponse httpGET(String url, List<HeaderEntry> headers);
-
- @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);
+ ServerResponse httpGET(String url, List<HeaderEntry> headers);
}

Powered by Google App Engine
This is Rietveld