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

Unified Diff: jni/JniWebRequest.cpp

Issue 5697499218051072: Usage of new API, cleanups (reduced) (Closed)
Patch Set: Removed another whitespace change Created April 28, 2014, 8:36 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 | « jni/JniLogSystem.cpp ('k') | jni/Utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jni/JniWebRequest.cpp
diff --git a/jni/JniWebRequest.cpp b/jni/JniWebRequest.cpp
index 172a6a0ddc829902b6000abca58dfc31de4f1662..54cad5fd386817bef36cf74c67de5efeafa58450 100644
--- a/jni/JniWebRequest.cpp
+++ b/jni/JniWebRequest.cpp
@@ -32,10 +32,10 @@ static void JNICALL JniDtor(JNIEnv* env, jclass clazz, jlong ptr)
}
JniWebRequest::JniWebRequest(JNIEnv* env, jobject callbackObject)
- : JniCallbackBase(env, callbackObject), AdblockPlus::WebRequest()
+ : JniCallbackBase(env, callbackObject), AdblockPlus::WebRequest(),
+ tupleClass(new JniGlobalReference<jclass>(env, env->FindClass(PKG("HeaderEntry")))),
+ serverResponseClass(new JniGlobalReference<jclass>(env, env->FindClass(PKG("ServerResponse"))))
{
- tupleClass.reset(new JniGlobalReference<jclass>(env, env->FindClass("com/github/rjeschke/neetutils/collections/Tuple")));
- serverResponseClass.reset(new JniGlobalReference<jclass>(env, env->FindClass(PKG("ServerResponse"))));
}
AdblockPlus::ServerResponse JniWebRequest::GET(const std::string& url, const AdblockPlus::HeaderList& requestHeaders) const
@@ -75,7 +75,7 @@ AdblockPlus::ServerResponse JniWebRequest::GET(const std::string& url, const Adb
jobject JniWebRequest::NewTuple(JNIEnv* env, const std::string& a, const std::string& b) const
{
- jmethodID factory = env->GetMethodID(tupleClass->Get(), "<init>", "(Ljava/lang/Object;Ljava/lang/Object;)V");
+ jmethodID factory = env->GetMethodID(tupleClass->Get(), "<init>", "(Ljava/lang/String;Ljava/lang/String;)V");
return env->NewObject(tupleClass->Get(), factory, env->NewStringUTF(a.c_str()), env->NewStringUTF(b.c_str()));
}
« no previous file with comments | « jni/JniLogSystem.cpp ('k') | jni/Utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld