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

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

Issue 29671734: Issue 6265 - Create shared AdblockEngine instance in AdblockWebView in background (Closed)
Patch Set: Created Jan. 17, 2018, 11:48 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-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/SettingsActivity.java
diff --git a/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/SettingsActivity.java b/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/SettingsActivity.java
index 73d51d4c28926fdf023eafb70c44f1f302271c61..201830dcdb54a80cf4eda1436d3b2f33bd102460 100644
--- a/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/SettingsActivity.java
+++ b/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/SettingsActivity.java
@@ -43,7 +43,9 @@ public class SettingsActivity
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
- AdblockHelper.get().retain(MainActivity.ADBLOCKENGINE_RETAIN_ASYNC);
sergei 2018/01/19 13:56:41 I'm not sure that changing from ADBLOCKENGINE_RETA
anton 2018/01/22 06:17:37 What do you mean "better"? Previously we had this
+
+ // retaining AdblockEngine asynchronously
+ AdblockHelper.get().getProvider().retain(true);
insertGeneralFragment();
}
@@ -75,8 +77,8 @@ public class SettingsActivity
public AdblockEngine getAdblockEngine()
{
// if it's retained asynchronously we have to wait until it's ready
- AdblockHelper.get().waitForReady();
- return AdblockHelper.get().getEngine();
+ AdblockHelper.get().getProvider().waitForReady();
+ return AdblockHelper.get().getProvider().getEngine();
}
@Override
@@ -112,6 +114,6 @@ public class SettingsActivity
protected void onDestroy()
{
super.onDestroy();
- AdblockHelper.get().release();
+ AdblockHelper.get().getProvider().release();
}
}

Powered by Google App Engine
This is Rietveld