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

Unified Diff: jni/JniFilterChangeCallback.cpp

Issue 5697499218051072: Usage of new API, cleanups (reduced) (Closed)
Patch Set: Created April 11, 2014, 1:31 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
Index: jni/JniFilterChangeCallback.cpp
diff --git a/jni/JniFilterChangeCallback.cpp b/jni/JniFilterChangeCallback.cpp
index c1e1996ab43eefd990d4d755f3b6e2656ca7ab59..717878a287dbccb9e7b7b8c8bc1e856ca8dc75b6 100644
--- a/jni/JniFilterChangeCallback.cpp
+++ b/jni/JniFilterChangeCallback.cpp
@@ -34,6 +34,7 @@ static void JNICALL JniDtor(JNIEnv* env, jclass clazz, jlong ptr)
JniFilterChangeCallback::JniFilterChangeCallback(JNIEnv* env, jobject callbackObject)
: JniCallbackBase(env, callbackObject)
{
+ jsValueClass.reset(new JniGlobalReference<jclass>(env, env->FindClass(PKG("JsValue"))));
Felix Dahlke 2014/04/16 15:24:25 Should be initialised in the initialisation list.
René Jeschke 2014/04/16 17:51:47 Done.
}
void JniFilterChangeCallback::Callback(const std::string& arg, const AdblockPlus::JsValuePtr jsValue)
@@ -46,7 +47,7 @@ void JniFilterChangeCallback::Callback(const std::string& arg, const AdblockPlus
if (method)
{
jstring jArg = env->NewStringUTF(arg.c_str());
- jobject jJsValue = NewJniJsValue(*env, jsValue);
+ jobject jJsValue = NewJniJsValue(*env, jsValue, jsValueClass->Get());
env->CallVoidMethod(GetCallbackObject(), method, jArg, jJsValue);
}

Powered by Google App Engine
This is Rietveld