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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 #ifndef UTILS_H | 18 #ifndef UTILS_H |
19 #define UTILS_H | 19 #define UTILS_H |
20 | 20 |
21 #include <string> | 21 #include <string> |
22 #include <algorithm> | 22 #include <algorithm> |
23 #include <jni.h> | 23 #include <jni.h> |
24 #include <stdexcept> | 24 #include <stdexcept> |
25 | 25 |
26 #include <AdblockPlus.h> | 26 #include <AdblockPlus.h> |
27 #include <AdblockPlus/tr1_memory.h> | 27 #include <AdblockPlus/tr1_memory.h> |
28 | 28 |
29 #include "v8/v8stdint.h" | |
30 | |
31 #define PKG(x) "org/adblockplus/libadblockplus/" x | 29 #define PKG(x) "org/adblockplus/libadblockplus/" x |
32 #define TYP(x) "L" PKG(x) ";" | 30 #define TYP(x) "L" PKG(x) ";" |
33 | 31 |
34 #define ABP_JNI_VERSION JNI_VERSION_1_6 | 32 #define ABP_JNI_VERSION JNI_VERSION_1_6 |
35 | 33 |
36 void JniThrowException(JNIEnv* env, const std::string& message); | 34 void JniThrowException(JNIEnv* env, const std::string& message); |
37 | 35 |
38 void JniThrowException(JNIEnv* env, const std::exception& e); | 36 void JniThrowException(JNIEnv* env, const std::exception& e); |
39 | 37 |
40 void JniThrowException(JNIEnv* env); | 38 void JniThrowException(JNIEnv* env); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 JniThrowException(jEnv, except); \ | 176 JniThrowException(jEnv, except); \ |
179 return retVal; \ | 177 return retVal; \ |
180 } \ | 178 } \ |
181 catch (...) \ | 179 catch (...) \ |
182 { \ | 180 { \ |
183 JniThrowException(jEnv); \ | 181 JniThrowException(jEnv); \ |
184 return retVal; \ | 182 return retVal; \ |
185 } | 183 } |
186 | 184 |
187 #endif | 185 #endif |
OLD | NEW |