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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 auto jsEngine = jniJsEngine->jsEngine; | 68 auto jsEngine = jniJsEngine->jsEngine; |
69 auto jniFilterEngine = new JniFilterEngine(); | 69 auto jniFilterEngine = new JniFilterEngine(); |
70 jniFilterEngine->timer = jniJsEngine->timer; | 70 jniFilterEngine->timer = jniJsEngine->timer; |
71 | 71 |
72 if (isAllowedConnectionCallbackPtr != 0) | 72 if (isAllowedConnectionCallbackPtr != 0) |
73 { | 73 { |
74 AdblockPlus::FilterEngine::CreationParameters creationParameters; | 74 AdblockPlus::FilterEngine::CreationParameters creationParameters; |
75 JniIsAllowedConnectionTypeCallback* callback = | 75 JniIsAllowedConnectionTypeCallback* callback = |
76 JniLongToTypePtr<JniIsAllowedConnectionTypeCallback>(isAllowedConnection
CallbackPtr); | 76 JniLongToTypePtr<JniIsAllowedConnectionTypeCallback>(isAllowedConnection
CallbackPtr); |
77 | 77 |
78 creationParameters.isSubscriptionDowloadAllowedCallback = | 78 creationParameters.isSubscriptionDownloadAllowedCallback = |
79 [callback](const std::string* allowedConnectionTypeArg, const std::funct
ion<void(bool)>& doneCallback) | 79 [callback](const std::string* allowedConnectionTypeArg, const std::funct
ion<void(bool)>& doneCallback) |
80 { | 80 { |
81 std::shared_ptr<std::string> allowedConnectionType; | 81 std::shared_ptr<std::string> allowedConnectionType; |
82 if (allowedConnectionTypeArg) | 82 if (allowedConnectionTypeArg) |
83 { | 83 { |
84 allowedConnectionType = std::make_shared<std::string>(*allowedConnecti
onTypeArg); | 84 allowedConnectionType = std::make_shared<std::string>(*allowedConnecti
onTypeArg); |
85 } | 85 } |
86 std::thread([callback, allowedConnectionType, doneCallback] | 86 std::thread([callback, allowedConnectionType, doneCallback] |
87 { | 87 { |
88 doneCallback(callback->Callback(allowedConnectionType.get())); | 88 doneCallback(callback->Callback(allowedConnectionType.get())); |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 { (char*)"isAcceptableAdsEnabled", (char*)"(J)Z", (void*)JniIsAcceptableAdsEna
bled }, | 587 { (char*)"isAcceptableAdsEnabled", (char*)"(J)Z", (void*)JniIsAcceptableAdsEna
bled }, |
588 { (char*)"getAcceptableAdsSubscriptionURL", (char*)"(J)Ljava/lang/String;", (v
oid*)JniGetAcceptableAdsSubscriptionURL }, | 588 { (char*)"getAcceptableAdsSubscriptionURL", (char*)"(J)Ljava/lang/String;", (v
oid*)JniGetAcceptableAdsSubscriptionURL }, |
589 { (char*)"dtor", (char*)"(J)V", (void*)JniDtor }, | 589 { (char*)"dtor", (char*)"(J)V", (void*)JniDtor }, |
590 { (char*)"updateFiltersAsync", (char*)"(JLjava/lang/String;)V", (void*)JniUpda
teFiltersAsync } | 590 { (char*)"updateFiltersAsync", (char*)"(JLjava/lang/String;)V", (void*)JniUpda
teFiltersAsync } |
591 }; | 591 }; |
592 | 592 |
593 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_FilterEngi
ne_registerNatives(JNIEnv *env, jclass clazz) | 593 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_FilterEngi
ne_registerNatives(JNIEnv *env, jclass clazz) |
594 { | 594 { |
595 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])); | 595 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])); |
596 } | 596 } |
OLD | NEW |