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

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

Issue 29354787: Issue 4442 - Cache class and ctors references in JNI_Load/UnLoad (Closed)
Patch Set: reverted to NewTuple Created Nov. 21, 2016, 8:25 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
« no previous file with comments | « libadblockplus-android/jni/JniJsValue.cpp ('k') | libadblockplus-android/jni/JniLogSystem.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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"
20 #include "JniLogSystem.h"
21 #include "JniCallbacks.h"
22 #include "JniNotification.h"
23 #include "JniWebRequest.h"
19 #include "Utils.h" 24 #include "Utils.h"
20 25
21 jint JNI_OnLoad(JavaVM* vm, void* reserved) 26 jint JNI_OnLoad(JavaVM* vm, void* reserved)
22 { 27 {
23 JNIEnv* env; 28 JNIEnv* env;
24 if (vm->GetEnv(reinterpret_cast<void**>(&env), ABP_JNI_VERSION) != JNI_OK) 29 if (vm->GetEnv(reinterpret_cast<void**>(&env), ABP_JNI_VERSION) != JNI_OK)
25 { 30 {
26 return JNI_ERR; 31 return JNI_ERR;
27 } 32 }
28 33
29 JniJsValue_OnLoad(vm, env, reserved); 34 JniJsValue_OnLoad(vm, env, reserved);
35 JniFilter_OnLoad(vm, env, reserved);
36 JniLogSystem_OnLoad(vm, env, reserved);
37 JniCallbacks_OnLoad(vm, env, reserved);
38 JniNotification_OnLoad(vm, env, reserved);
39 JniWebRequest_OnLoad(vm, env, reserved);
40 JniUtils_OnLoad(vm, env, reserved);
30 41
31 return ABP_JNI_VERSION; 42 return ABP_JNI_VERSION;
32 } 43 }
33 44
34 void JNI_OnUnload(JavaVM* vm, void* reserved) 45 void JNI_OnUnload(JavaVM* vm, void* reserved)
35 { 46 {
36 JNIEnv* env; 47 JNIEnv* env;
37 if (vm->GetEnv(reinterpret_cast<void**>(&env), ABP_JNI_VERSION) != JNI_OK) 48 if (vm->GetEnv(reinterpret_cast<void**>(&env), ABP_JNI_VERSION) != JNI_OK)
38 { 49 {
39 return; 50 return;
40 } 51 }
41 52
42 JniJsValue_OnUnload(vm, env, reserved); 53 JniJsValue_OnUnload(vm, env, reserved);
54 JniFilter_OnUnload(vm, env, reserved);
55 JniLogSystem_OnUnload(vm, env, reserved);
56 JniCallbacks_OnUnload(vm, env, reserved);
57 JniNotification_OnUnload(vm, env, reserved);
58 JniWebRequest_OnUnload(vm, env, reserved);
59 JniUtils_OnUnload(vm, env, reserved);
43 } 60 }
OLDNEW
« no previous file with comments | « libadblockplus-android/jni/JniJsValue.cpp ('k') | libadblockplus-android/jni/JniLogSystem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld