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

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

Issue 29422558: Issue 5167 - Update to use libadblockplus revision dca8df9af1a7 (Closed)
Patch Set: updated dependencies (..-binaries) Created May 3, 2017, 2:08 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
« no previous file with comments | « libadblockplus-android/jni/JniFilterEngine.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/JniJsEngine.cpp
diff --git a/libadblockplus-android/jni/JniJsEngine.cpp b/libadblockplus-android/jni/JniJsEngine.cpp
index d30cb3376830a5ea43fea013a4e6c4b08b58bea4..8633ca711244bfb729e07c5818b1ba67ac9dfec2 100644
--- a/libadblockplus-android/jni/JniJsEngine.cpp
+++ b/libadblockplus-android/jni/JniJsEngine.cpp
@@ -56,7 +56,8 @@ static void JNICALL JniSetEventCallback(JNIEnv* env, jclass clazz, jlong ptr, js
JniEventCallback* callback = JniLongToTypePtr<JniEventCallback>(jCallbackPtr);
std::string eventName = JniJavaToStdString(env, jEventName);
- AdblockPlus::JsEngine::EventCallback eCallback = std::bind(&JniEventCallback::Callback, callback, std::placeholders::_1);
+ AdblockPlus::JsEngine::EventCallback eCallback =
+ std::bind(&JniEventCallback::Callback, callback, std::placeholders::_1);
try
{
@@ -87,8 +88,7 @@ static jobject JNICALL JniEvaluate(JNIEnv* env, jclass clazz, jlong ptr, jstring
try
{
- AdblockPlus::JsValuePtr jsValue = engine->Evaluate(source, filename);
- return NewJniJsValue(env, jsValue);
+ return NewJniJsValue(env, engine->Evaluate(source, filename));
}
CATCH_THROW_AND_RETURN(env, 0)
}
@@ -107,7 +107,7 @@ static void JNICALL JniTriggerEvent(JNIEnv* env, jclass clazz, jlong ptr, jstrin
for (jsize i = 0; i < length; i++)
{
- args.push_back(JniGetJsValuePtr(ptrs[i]));
+ args.push_back(JniGetJsValue(ptrs[i]));
}
env->ReleasePrimitiveArrayCritical(jJsPtrs, ptrs, JNI_ABORT);
@@ -143,7 +143,6 @@ static void JNICALL JniSetDefaultWebRequest(JNIEnv* env, jclass clazz, jlong ptr
try
{
AdblockPlus::WebRequestPtr webRequest(new AdblockPlus::DefaultWebRequest());
-
engine->SetWebRequest(webRequest);
}
CATCH_AND_THROW(env)
@@ -194,8 +193,7 @@ static jobject JNICALL JniNewLongValue(JNIEnv* env, jclass clazz, jlong ptr, jlo
try
{
- AdblockPlus::JsValuePtr jsValue = engine->NewValue(static_cast<int64_t>(value));
- return NewJniJsValue(env, jsValue);
+ return NewJniJsValue(env, engine->NewValue(static_cast<int64_t>(value)));
}
CATCH_THROW_AND_RETURN(env, 0)
}
@@ -206,8 +204,7 @@ static jobject JNICALL JniNewBooleanValue(JNIEnv* env, jclass clazz, jlong ptr,
try
{
- AdblockPlus::JsValuePtr jsValue = engine->NewValue(value == JNI_TRUE ? true : false);
- return NewJniJsValue(env, jsValue);
+ return NewJniJsValue(env, engine->NewValue(value == JNI_TRUE ? true : false));
}
CATCH_THROW_AND_RETURN(env, 0)
}
@@ -219,8 +216,7 @@ static jobject JNICALL JniNewStringValue(JNIEnv* env, jclass clazz, jlong ptr, j
try
{
std::string strValue = JniJavaToStdString(env, value);
- AdblockPlus::JsValuePtr jsValue = engine->NewValue(strValue);
- return NewJniJsValue(env, jsValue);
+ return NewJniJsValue(env, engine->NewValue(strValue));
}
CATCH_THROW_AND_RETURN(env, 0)
}
« no previous file with comments | « libadblockplus-android/jni/JniFilterEngine.cpp ('k') | libadblockplus-android/jni/JniJsValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld