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

Unified Diff: jni/JniJsValue.h

Issue 6606493159784448: New JNI bindings (Closed)
Patch Set: Added LICENSE, moved callback impls into cpp files. Created March 20, 2014, 3:12 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 | « jni/JniJsEngine.cpp ('k') | jni/JniJsValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jni/JniJsValue.h
diff --git a/jni/Utils.cpp b/jni/JniJsValue.h
similarity index 59%
copy from jni/Utils.cpp
copy to jni/JniJsValue.h
index b4c7cb60e982458591b1c75958a25b3f9c13912c..4a03578d025b9445cbf431f70260e328da3d1cd4 100644
--- a/jni/Utils.cpp
+++ b/jni/JniJsValue.h
@@ -15,24 +15,26 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Utils.h"
-#include "Debug.h"
+#ifndef JNIJSVALUE_H_
+#define JNIJSVALUE_H_
-const std::string GetString(JNIEnv *pEnv, jstring str)
+#include <jni.h>
+#include <AdblockPlus/JsValue.h>
+
+namespace AdblockPlus
+{
+namespace Android
{
- D(D_WARN, "getString()");
- if (str == NULL)
- return std::string();
+jobject NewJniJsValue(JNIEnv* env, const AdblockPlus::JsValuePtr& jsValue);
- jboolean iscopy;
+jobject JniJsValueList2ArrayList(JNIEnv* env, AdblockPlus::JsValueList& list);
- const char *s = pEnv->GetStringUTFChars(str, &iscopy);
- jsize len = pEnv->GetStringUTFLength(str);
+AdblockPlus::JsValue* JniGetJsValue(jlong ptr);
- const std::string value(s, len);
+AdblockPlus::JsValuePtr& JniGetJsValuePtr(jlong ptr);
- pEnv->ReleaseStringUTFChars(str, s);
+} // namespace Android
+} // namespace AdblockPlus
- return value;
-}
+#endif /* JNIJSVALUE_H_ */
« no previous file with comments | « jni/JniJsEngine.cpp ('k') | jni/JniJsValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld