LEFT | RIGHT |
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 CATCH_AND_THROW(env) | 136 CATCH_AND_THROW(env) |
137 } | 137 } |
138 | 138 |
139 static void JNICALL JniSetFileSystem(JNIEnv* env, jclass clazz, jlong ptr, jlong
fileSystemPtr) | 139 static void JNICALL JniSetFileSystem(JNIEnv* env, jclass clazz, jlong ptr, jlong
fileSystemPtr) |
140 { | 140 { |
141 AdblockPlus::JsEnginePtr& engine = *JniLongToTypePtr<AdblockPlus::JsEnginePtr>
(ptr); | 141 AdblockPlus::JsEnginePtr& engine = *JniLongToTypePtr<AdblockPlus::JsEnginePtr>
(ptr); |
142 | 142 |
143 try | 143 try |
144 { | 144 { |
145 AdblockPlus::FileSystemPtr fileSystem(JniLongToTypePtr<JniFileSystemCallback
>(fileSystemPtr)); | 145 AdblockPlus::FileSystemPtr fileSystem = *JniLongToTypePtr<AdblockPlus::FileS
ystemPtr>(fileSystemPtr); |
146 | |
147 engine->SetFileSystem(fileSystem); | 146 engine->SetFileSystem(fileSystem); |
148 } | 147 } |
149 CATCH_AND_THROW(env) | 148 CATCH_AND_THROW(env) |
150 } | 149 } |
151 | 150 |
152 static void JNICALL JniSetDefaultWebRequest(JNIEnv* env, jclass clazz, jlong ptr
) | 151 static void JNICALL JniSetDefaultWebRequest(JNIEnv* env, jclass clazz, jlong ptr
) |
153 { | 152 { |
154 AdblockPlus::JsEnginePtr& engine = *JniLongToTypePtr<AdblockPlus::JsEnginePtr>
(ptr); | 153 AdblockPlus::JsEnginePtr& engine = *JniLongToTypePtr<AdblockPlus::JsEnginePtr>
(ptr); |
155 | 154 |
156 try | 155 try |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 263 |
265 { (char*)"newValue", (char*)"(JJ)" TYP("JsValue"), (void*)JniNewLongValue }, | 264 { (char*)"newValue", (char*)"(JJ)" TYP("JsValue"), (void*)JniNewLongValue }, |
266 { (char*)"newValue", (char*)"(JZ)" TYP("JsValue"), (void*)JniNewBooleanValue }
, | 265 { (char*)"newValue", (char*)"(JZ)" TYP("JsValue"), (void*)JniNewBooleanValue }
, |
267 { (char*)"newValue", (char*)"(JLjava/lang/String;)" TYP("JsValue"), (void*)Jni
NewStringValue } | 266 { (char*)"newValue", (char*)"(JLjava/lang/String;)" TYP("JsValue"), (void*)Jni
NewStringValue } |
268 }; | 267 }; |
269 | 268 |
270 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_JsEngine_r
egisterNatives(JNIEnv *env, jclass clazz) | 269 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_JsEngine_r
egisterNatives(JNIEnv *env, jclass clazz) |
271 { | 270 { |
272 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])); | 271 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])); |
273 } | 272 } |
LEFT | RIGHT |