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

Side by Side Diff: libadblockplus-android/jni/JniNotification.cpp

Issue 29422558: Issue 5167 - Update to use libadblockplus revision dca8df9af1a7 (Closed)
Patch Set: using move ctors, reverted some unrelated changes Created April 27, 2017, 6:19 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 19 matching lines...) Expand all
30 { 30 {
31 if (notificationEnumClass) 31 if (notificationEnumClass)
32 { 32 {
33 delete notificationEnumClass; 33 delete notificationEnumClass;
34 notificationEnumClass = NULL; 34 notificationEnumClass = NULL;
35 } 35 }
36 } 36 }
37 37
38 static AdblockPlus::Notification* GetNotificationPtr(jlong ptr) 38 static AdblockPlus::Notification* GetNotificationPtr(jlong ptr)
39 { 39 {
40 return JniLongToTypePtr<AdblockPlus::NotificationPtr>(ptr)->get(); 40 return JniLongToTypePtr<AdblockPlus::Notification>(ptr);
41 } 41 }
42 42
43 static jobject JNICALL JniGetType(JNIEnv* env, jclass clazz, jlong ptr) 43 static jobject JNICALL JniGetType(JNIEnv* env, jclass clazz, jlong ptr)
44 { 44 {
45 AdblockPlus::NotificationType type; 45 AdblockPlus::NotificationType type;
46 try 46 try
47 { 47 {
48 type = GetNotificationPtr(ptr)->GetType(); 48 type = GetNotificationPtr(ptr)->GetType();
49 } 49 }
50 CATCH_THROW_AND_RETURN(env, 0) 50 CATCH_THROW_AND_RETURN(env, 0)
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 { (char*) "getTitle", (char*) "(J)Ljava/lang/String;", (void*) JniGetTitle }, 109 { (char*) "getTitle", (char*) "(J)Ljava/lang/String;", (void*) JniGetTitle },
110 { (char*) "getType", (char*) "(J)" TYP("Notification$Type"), (void*) JniGetTyp e } 110 { (char*) "getType", (char*) "(J)" TYP("Notification$Type"), (void*) JniGetTyp e }
111 }; 111 };
112 112
113 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_Notificati on_registerNatives( 113 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_Notificati on_registerNatives(
114 JNIEnv *env, jclass clazz) 114 JNIEnv *env, jclass clazz)
115 { 115 {
116 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])); 116 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0]));
117 } 117 }
118 118
OLDNEW
« no previous file with comments | « libadblockplus-android/jni/JniJsValue.cpp ('k') | libadblockplus-android/jni/JniShowNotificationCallback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld