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

Unified Diff: libadblockplus-android/jni/JniFilterEngine.cpp

Issue 29556626: Issue 5790 - Get ready for integration into Chromium (Closed)
Patch Set: Created Sept. 26, 2017, 11:29 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/jni/JniFilterEngine.cpp
diff --git a/libadblockplus-android/jni/JniFilterEngine.cpp b/libadblockplus-android/jni/JniFilterEngine.cpp
index 1f59aac630f338d3a92483dddde2b57cc2018b3f..a1d25bf3e2eaafa70c33cc8f30d21961526d6271 100644
--- a/libadblockplus-android/jni/JniFilterEngine.cpp
+++ b/libadblockplus-android/jni/JniFilterEngine.cpp
@@ -499,6 +499,16 @@ static void JNICALL JniUpdateFiltersAsync(JNIEnv* env, jclass clazz, jlong jniPl
});
}
+static jlong JNICALL JniGetFilterEnginePtr(JNIEnv* env, jclass clazz, jlong ptr)
+{
+ try
+ {
+ AdblockPlus::FilterEngine& engine = GetFilterEngineRef(ptr);
+ return (jlong)&engine;
+ }
+ CATCH_THROW_AND_RETURN(env, 0);
+}
+
static JNINativeMethod methods[] =
{
{ (char*)"isFirstRun", (char*)"(J)Z", (void*)JniIsFirstRun },
@@ -528,7 +538,8 @@ static JNINativeMethod methods[] =
{ (char*)"setAcceptableAdsEnabled", (char*)"(JZ)V", (void*)JniSetAcceptableAdsEnabled },
{ (char*)"isAcceptableAdsEnabled", (char*)"(J)Z", (void*)JniIsAcceptableAdsEnabled },
{ (char*)"getAcceptableAdsSubscriptionURL", (char*)"(J)Ljava/lang/String;", (void*)JniGetAcceptableAdsSubscriptionURL },
- { (char*)"updateFiltersAsync", (char*)"(JLjava/lang/String;)V", (void*)JniUpdateFiltersAsync }
+ { (char*)"updateFiltersAsync", (char*)"(JLjava/lang/String;)V", (void*)JniUpdateFiltersAsync },
+ { (char*)"getFilterEnginePtr", (char*)"(J)J", (void*)JniGetFilterEnginePtr }
};
extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_FilterEngine_registerNatives(JNIEnv *env, jclass clazz)

Powered by Google App Engine
This is Rietveld