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

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

Issue 29354787: Issue 4442 - Cache class and ctors references in JNI_Load/UnLoad (Closed)
Patch Set: reverted to NewTuple Created Nov. 21, 2016, 8:25 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
« no previous file with comments | « libadblockplus-android/jni/JniFilter.cpp ('k') | libadblockplus-android/jni/JniJsValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libadblockplus-android/jni/JniFilterChangeCallback.cpp
diff --git a/libadblockplus-android/jni/JniFilterChangeCallback.cpp b/libadblockplus-android/jni/JniFilterChangeCallback.cpp
index 406f4fe1bb59531a634bc27e1b706cd20cab8389..28959b34a2b802ef75a0ea810d9c8aaacb9e6218 100644
--- a/libadblockplus-android/jni/JniFilterChangeCallback.cpp
+++ b/libadblockplus-android/jni/JniFilterChangeCallback.cpp
@@ -33,8 +33,7 @@ static void JNICALL JniDtor(JNIEnv* env, jclass clazz, jlong ptr)
JniFilterChangeCallback::JniFilterChangeCallback(JNIEnv* env,
jobject callbackObject)
- : JniCallbackBase(env, callbackObject), jsValueClass(
- new JniGlobalReference<jclass>(env, env->FindClass(PKG("JsValue"))))
+ : JniCallbackBase(env, callbackObject)
{
}
@@ -51,8 +50,7 @@ void JniFilterChangeCallback::Callback(const std::string& arg,
if (method)
{
JniLocalReference<jstring> jArg(*env, env->NewStringUTF(arg.c_str()));
- JniLocalReference<jobject> jJsValue(*env,
- NewJniJsValue(*env, jsValue, jsValueClass->Get()));
+ JniLocalReference<jobject> jJsValue(*env, NewJniJsValue(*env, jsValue, GetJsValueClass()));
env->CallVoidMethod(GetCallbackObject(), method, *jArg, *jJsValue);
}
« no previous file with comments | « libadblockplus-android/jni/JniFilter.cpp ('k') | libadblockplus-android/jni/JniJsValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld