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

Unified Diff: libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.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 comment Created Sept. 8, 2017, 12:20 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
« no previous file with comments | « libadblockplus-android/src/org/adblockplus/libadblockplus/Platform.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 95b79a99fadb3563ead38b3987a172a661181390..f7d2ec6e40ff4e783aeda8515d9c0337fc1953a6 100644
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java
@@ -32,9 +32,9 @@ import org.adblockplus.libadblockplus.FilterChangeCallback;
import org.adblockplus.libadblockplus.FilterEngine;
import org.adblockplus.libadblockplus.FilterEngine.ContentType;
import org.adblockplus.libadblockplus.IsAllowedConnectionCallback;
-import org.adblockplus.libadblockplus.JsEngine;
import org.adblockplus.libadblockplus.JsValue;
import org.adblockplus.libadblockplus.LogSystem;
+import org.adblockplus.libadblockplus.Platform;
import org.adblockplus.libadblockplus.ShowNotificationCallback;
import org.adblockplus.libadblockplus.Subscription;
import org.adblockplus.libadblockplus.UpdateAvailableCallback;
@@ -67,7 +67,7 @@ public final class AdblockEngine
* volatile, this seems to prevent the JNI from 'optimizing away' those objects (as a volatile
* variable might be changed at any time from any thread).
*/
- private volatile JsEngine jsEngine;
+ private volatile Platform platform;
private volatile FilterEngine filterEngine;
private volatile LogSystem logSystem;
private volatile WebRequest webRequest;
@@ -254,9 +254,10 @@ public final class AdblockEngine
private void createEngines()
{
engine.logSystem = new AndroidLogSystem();
- engine.jsEngine = new JsEngine(appInfo, engine.logSystem, engine.webRequest, basePath);
-
- engine.filterEngine = new FilterEngine(engine.jsEngine, isAllowedConnectionCallback);
+ engine.platform = new Platform(engine.logSystem, engine.webRequest, basePath);
+ engine.platform.setUpJsEngine(appInfo);
+ engine.platform.setUpFilterEngine(isAllowedConnectionCallback);
+ engine.filterEngine = engine.platform.getFilterEngine();
}
}
@@ -287,14 +288,8 @@ public final class AdblockEngine
this.filterEngine.removeShowNotificationCallback();
}
- this.filterEngine.dispose();
- this.filterEngine = null;
- }
-
- if (this.jsEngine != null)
- {
- this.jsEngine.dispose();
- this.jsEngine = null;
+ this.platform.dispose();
+ this.platform = null;
}
// callbacks then
« no previous file with comments | « libadblockplus-android/src/org/adblockplus/libadblockplus/Platform.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld