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

Unified Diff: jni/Utils.h

Issue 5327480814567424: Issue 1108 - Support notifications (Closed)
Patch Set: Even more renaming, ignore INVALID/QUESTION Created Feb. 18, 2015, 3 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: jni/Utils.h
diff --git a/jni/Utils.h b/jni/Utils.h
index 8259e5c7dac0296168eb36d0c5ad2a8034050d9d..e7def9eea2ed98d7123ca051fde9b066ed63d759 100644
--- a/jni/Utils.h
+++ b/jni/Utils.h
@@ -147,8 +147,6 @@ inline T* JniLongToTypePtr(jlong value)
return reinterpret_cast<T*>((size_t)value);
}
-jobject NewJniArrayList(JNIEnv* env);
-
std::string JniJavaToStdString(JNIEnv* env, jstring str);
void JniAddObjectToList(JNIEnv* env, jobject list, jobject value);
@@ -173,32 +171,15 @@ inline int64_t JniGetLongField(JNIEnv* env, jclass clazz, jobject jObj, const ch
return (int64_t)env->GetLongField(jObj, env->GetFieldID(clazz, name, "J"));
}
-inline jobject NewJniFilter(JNIEnv* env, const AdblockPlus::FilterPtr& filter)
-{
- if (!filter.get())
- {
- return 0;
- }
+jobject NewJniArrayList(JNIEnv* env);
- JniLocalReference<jclass> clazz(env, env->FindClass(PKG("Filter")));
- jmethodID method = env->GetMethodID(*clazz, "<init>", "(J)V");
- return env->NewObject(*clazz, method,
- JniPtrToLong(new AdblockPlus::FilterPtr(filter)));
-}
+jobject NewJniFilter(JNIEnv* env, const AdblockPlus::FilterPtr& filter);
-inline jobject NewJniSubscription(JNIEnv* env,
- const AdblockPlus::SubscriptionPtr& subscription)
-{
- if (!subscription.get())
- {
- return 0;
- }
+jobject NewJniSubscription(JNIEnv* env,
+ const AdblockPlus::SubscriptionPtr& subscription);
- JniLocalReference<jclass> clazz(env, env->FindClass(PKG("Subscription")));
- jmethodID method = env->GetMethodID(*clazz, "<init>", "(J)V");
- return env->NewObject(*clazz, method,
- JniPtrToLong(new AdblockPlus::SubscriptionPtr(subscription)));
-}
+jobject NewJniNotification(JNIEnv* env,
+ const AdblockPlus::NotificationPtr& notification);
#define CATCH_AND_THROW(jEnv) \
catch (const std::exception& except) \

Powered by Google App Engine
This is Rietveld