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

Unified Diff: libadblockplus-android/jni/JniJsEngine.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/JniJsEngine.cpp
diff --git a/libadblockplus-android/jni/JniJsEngine.cpp b/libadblockplus-android/jni/JniJsEngine.cpp
index fb56ce104207383e41324dde688bbf3a2567d4c6..e5b08d59fb90b39fb9f4cc5d49e2a56bad128f4b 100644
--- a/libadblockplus-android/jni/JniJsEngine.cpp
+++ b/libadblockplus-android/jni/JniJsEngine.cpp
@@ -40,7 +40,7 @@ static AdblockPlus::JsEngine& GetJsEngineRef(jlong ptr)
}
static jlong JNICALL JniCtor(JNIEnv* env, jclass clazz, jobject jAppInfo,
- jobject logSystem, jlong webRequestPtr)
+ jobject logSystem, jobject webRequest)
{
AdblockPlus::AppInfo appInfo;
@@ -56,9 +56,9 @@ static jlong JNICALL JniCtor(JNIEnv* env, jclass clazz, jobject jAppInfo,
{
jniJsEngine->jsEngine->SetLogSystem(std::make_shared<JniLogSystemCallback>(env, logSystem));
}
- if (webRequestPtr)
+ if (webRequest)
{
- jniJsEngine->jsEngine->SetWebRequest(*JniLongToTypePtr<AdblockPlus::WebRequestSharedPtr>(webRequestPtr));
+ jniJsEngine->jsEngine->SetWebRequest(std::make_shared<JniWebRequest>(env, webRequest));
}
return JniPtrToLong(jniJsEngine);
@@ -202,7 +202,7 @@ static jobject JNICALL JniNewStringValue(JNIEnv* env, jclass clazz, jlong ptr, j
static JNINativeMethod methods[] =
{
- { (char*)"ctor", (char*)"(" TYP("AppInfo") TYP("LogSystem")"J)J", (void*)JniCtor },
+ { (char*)"ctor", (char*)"(" TYP("AppInfo") TYP("LogSystem") TYP("WebRequest") ")J", (void*)JniCtor },
{ (char*)"dtor", (char*)"(J)V", (void*)JniDtor },
{ (char*)"setEventCallback", (char*)"(JLjava/lang/String;J)V", (void*)JniSetEventCallback },

Powered by Google App Engine
This is Rietveld