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: Created Jan. 30, 2015, 12:44 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/JniNotification.cpp ('k') | src/org/adblockplus/libadblockplus/FilterEngine.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jni/Utils.h
diff --git a/jni/Utils.h b/jni/Utils.h
index 852457cdd95095e57e8232fe2b40ae316814c636..d77f37bb5f0fe0dbfd98a6641b73cc4f2d22eef6 100644
--- a/jni/Utils.h
+++ b/jni/Utils.h
@@ -162,6 +162,18 @@ inline jobject NewJniSubscription(JNIEnv* env, const AdblockPlus::SubscriptionPt
return env->NewObject(clazz, method, JniPtrToLong(new AdblockPlus::SubscriptionPtr(subscription)));
}
+inline jobject NewJniNotification(JNIEnv* env, const AdblockPlus::NotificationPtr& notification)
+{
+ if (!notification.get())
+ {
+ return 0;
+ }
+
+ jclass clazz = env->FindClass(PKG("Notification"));
+ jmethodID method = env->GetMethodID(clazz, "<init>", "(J)V");
+ return env->NewObject(clazz, method, JniPtrToLong(new AdblockPlus::NotificationPtr(notification)));
+}
+
#define CATCH_AND_THROW(jEnv) \
catch (const std::exception& except) \
{ \
« no previous file with comments | « jni/JniNotification.cpp ('k') | src/org/adblockplus/libadblockplus/FilterEngine.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld