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: Renamed to getNativePtr() Created Sept. 28, 2017, 9:08 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..25134f429cc65efe97f2b100390df51bb1f6737e 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 JniGetFilterEngineNativePtr(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*)"getNativePtr", (char*)"(J)J", (void*)JniGetFilterEngineNativePtr }
};
extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_FilterEngine_registerNatives(JNIEnv *env, jclass clazz)

Powered by Google App Engine
This is Rietveld