| 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 |
| 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 #include "JniJsValue.h" | 18 #include "JniJsValue.h" |
| 19 #include "JniFilter.h" | 19 #include "JniFilter.h" |
| 20 #include "JniLogSystem.h" | 20 #include "JniLogSystem.h" |
| 21 #include "JniCallbacks.h" | 21 #include "JniCallbacks.h" |
| 22 #include "JniNotification.h" | 22 #include "JniNotification.h" |
| 23 #include "JniWebRequest.h" | 23 #include "JniWebRequest.h" |
| 24 #include "JniFileSystem.h" |
| 24 #include "Utils.h" | 25 #include "Utils.h" |
| 25 | 26 |
| 26 jint JNI_OnLoad(JavaVM* vm, void* reserved) | 27 jint JNI_OnLoad(JavaVM* vm, void* reserved) |
| 27 { | 28 { |
| 28 JNIEnv* env; | 29 JNIEnv* env; |
| 29 if (vm->GetEnv(reinterpret_cast<void**>(&env), ABP_JNI_VERSION) != JNI_OK) | 30 if (vm->GetEnv(reinterpret_cast<void**>(&env), ABP_JNI_VERSION) != JNI_OK) |
| 30 { | 31 { |
| 31 return JNI_ERR; | 32 return JNI_ERR; |
| 32 } | 33 } |
| 33 | 34 |
| 34 JniJsValue_OnLoad(vm, env, reserved); | 35 JniJsValue_OnLoad(vm, env, reserved); |
| 35 JniFilter_OnLoad(vm, env, reserved); | 36 JniFilter_OnLoad(vm, env, reserved); |
| 36 JniLogSystem_OnLoad(vm, env, reserved); | 37 JniLogSystem_OnLoad(vm, env, reserved); |
| 37 JniCallbacks_OnLoad(vm, env, reserved); | 38 JniCallbacks_OnLoad(vm, env, reserved); |
| 38 JniNotification_OnLoad(vm, env, reserved); | 39 JniNotification_OnLoad(vm, env, reserved); |
| 39 JniWebRequest_OnLoad(vm, env, reserved); | 40 JniWebRequest_OnLoad(vm, env, reserved); |
| 41 JniFileSystem_OnLoad(vm, env, reserved); |
| 40 JniUtils_OnLoad(vm, env, reserved); | 42 JniUtils_OnLoad(vm, env, reserved); |
| 41 | 43 |
| 42 return ABP_JNI_VERSION; | 44 return ABP_JNI_VERSION; |
| 43 } | 45 } |
| 44 | 46 |
| 45 void JNI_OnUnload(JavaVM* vm, void* reserved) | 47 void JNI_OnUnload(JavaVM* vm, void* reserved) |
| 46 { | 48 { |
| 47 JNIEnv* env; | 49 JNIEnv* env; |
| 48 if (vm->GetEnv(reinterpret_cast<void**>(&env), ABP_JNI_VERSION) != JNI_OK) | 50 if (vm->GetEnv(reinterpret_cast<void**>(&env), ABP_JNI_VERSION) != JNI_OK) |
| 49 { | 51 { |
| 50 return; | 52 return; |
| 51 } | 53 } |
| 52 | 54 |
| 53 JniJsValue_OnUnload(vm, env, reserved); | 55 JniJsValue_OnUnload(vm, env, reserved); |
| 54 JniFilter_OnUnload(vm, env, reserved); | 56 JniFilter_OnUnload(vm, env, reserved); |
| 55 JniLogSystem_OnUnload(vm, env, reserved); | 57 JniLogSystem_OnUnload(vm, env, reserved); |
| 56 JniCallbacks_OnUnload(vm, env, reserved); | 58 JniCallbacks_OnUnload(vm, env, reserved); |
| 57 JniNotification_OnUnload(vm, env, reserved); | 59 JniNotification_OnUnload(vm, env, reserved); |
| 58 JniWebRequest_OnUnload(vm, env, reserved); | 60 JniWebRequest_OnUnload(vm, env, reserved); |
| 61 JniFileSystem_OnUnload(vm, env, reserved); |
| 59 JniUtils_OnUnload(vm, env, reserved); | 62 JniUtils_OnUnload(vm, env, reserved); |
| 60 } | 63 } |
| OLD | NEW |