OLD | NEW |
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 21 matching lines...) Expand all Loading... |
32 { | 32 { |
33 if (filterEnumClass) | 33 if (filterEnumClass) |
34 { | 34 { |
35 delete filterEnumClass; | 35 delete filterEnumClass; |
36 filterEnumClass = NULL; | 36 filterEnumClass = NULL; |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 static AdblockPlus::Filter* GetFilterPtr(jlong ptr) | 40 static AdblockPlus::Filter* GetFilterPtr(jlong ptr) |
41 { | 41 { |
42 return JniLongToTypePtr<AdblockPlus::FilterPtr>(ptr)->get(); | 42 return JniLongToTypePtr<AdblockPlus::Filter>(ptr); |
43 } | 43 } |
44 | 44 |
45 static jobject JNICALL JniGetType(JNIEnv* env, jclass clazz, jlong ptr) | 45 static jobject JNICALL JniGetType(JNIEnv* env, jclass clazz, jlong ptr) |
46 { | 46 { |
47 AdblockPlus::Filter::Type type; | 47 AdblockPlus::Filter::Type type; |
48 try | 48 try |
49 { | 49 { |
50 type = GetFilterPtr(ptr)->GetType(); | 50 type = GetFilterPtr(ptr)->GetType(); |
51 } | 51 } |
52 CATCH_THROW_AND_RETURN(env, 0) | 52 CATCH_THROW_AND_RETURN(env, 0) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 { (char*)"isListed", (char*)"(J)Z", (void*)JniIsListed }, | 124 { (char*)"isListed", (char*)"(J)Z", (void*)JniIsListed }, |
125 { (char*)"addToList", (char*)"(J)V", (void*)JniAddToList }, | 125 { (char*)"addToList", (char*)"(J)V", (void*)JniAddToList }, |
126 { (char*)"removeFromList", (char*)"(J)V", (void*)JniRemoveFromList }, | 126 { (char*)"removeFromList", (char*)"(J)V", (void*)JniRemoveFromList }, |
127 { (char*)"operatorEquals", (char*)"(JJ)Z", (void*)JniOperatorEquals } | 127 { (char*)"operatorEquals", (char*)"(JJ)Z", (void*)JniOperatorEquals } |
128 }; | 128 }; |
129 | 129 |
130 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_Filter_reg
isterNatives(JNIEnv *env, jclass clazz) | 130 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_Filter_reg
isterNatives(JNIEnv *env, jclass clazz) |
131 { | 131 { |
132 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])); | 132 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])); |
133 } | 133 } |
OLD | NEW |