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

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

Issue 29526710: Issue 5556 - make C++ implementation of WebRequest manageable only by JsEngine (Closed) Base URL: github.com:abby-sergz/libadblockplus-android.git
Patch Set: Created Aug. 24, 2017, 5:26 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: libadblockplus-android/jni/JniWebRequest.cpp
diff --git a/libadblockplus-android/jni/JniWebRequest.cpp b/libadblockplus-android/jni/JniWebRequest.cpp
index 20f9dbff5eb7f037f8006b49e91fb336227de7a2..e2d61be62f92c3797f106a77fe63c534586fb63c 100644
--- a/libadblockplus-android/jni/JniWebRequest.cpp
+++ b/libadblockplus-android/jni/JniWebRequest.cpp
@@ -44,22 +44,8 @@ void JniWebRequest_OnUnload(JavaVM* vm, JNIEnv* env, void* reserved)
}
}
-static jlong JNICALL JniCtor(JNIEnv* env, jclass clazz, jobject callbackObject)
-{
- try
- {
- return JniPtrToLong(new AdblockPlus::WebRequestSharedPtr(std::make_shared<JniWebRequest>(env, callbackObject)));
- }
- CATCH_THROW_AND_RETURN(env, 0)
-}
-
-static void JNICALL JniDtor(JNIEnv* env, jclass clazz, jlong ptr)
-{
- delete JniLongToTypePtr<AdblockPlus::WebRequestSharedPtr>(ptr);
-}
-
JniWebRequest::JniWebRequest(JNIEnv* env, jobject callbackObject)
- : JniCallbackBase(env, callbackObject), AdblockPlus::WebRequest()
+ : JniCallbackBase(env, callbackObject)
{
}
@@ -146,15 +132,4 @@ jobject JniWebRequest::NewTuple(JNIEnv* env, const std::string& a,
JniLocalReference<jstring> strB(env, env->NewStringUTF(b.c_str()));
return env->NewObject(headerEntryClass->Get(), factory, *strA, *strB);
-}
-
-static JNINativeMethod methods[] =
-{
- { (char*)"ctor", (char*)"(Ljava/lang/Object;)J", (void*)JniCtor },
- { (char*)"dtor", (char*)"(J)V", (void*)JniDtor }
-};
-
-extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_WebRequest_registerNatives(JNIEnv *env, jclass clazz)
-{
- env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0]));
-}
+}
« no previous file with comments | « libadblockplus-android/jni/JniJsEngine.cpp ('k') | libadblockplus-android/src/org/adblockplus/libadblockplus/JsEngine.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld