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

Delta Between Two Patch Sets: libadblockplus-android/jni/JniFilterEngine.cpp

Issue 29556626: Issue 5790 - Get ready for integration into Chromium (Closed)
Left Patch Set: Created Sept. 26, 2017, 11:29 a.m.
Right Patch Set: Renamed to getNativePtr() Created Sept. 28, 2017, 9:08 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 { 492 {
493 if (stringBeginsWith(subscriptionUrl, subscription.GetProperty("url").AsSt ring())) 493 if (stringBeginsWith(subscriptionUrl, subscription.GetProperty("url").AsSt ring()))
494 { 494 {
495 subscription.UpdateFilters(); 495 subscription.UpdateFilters();
496 return; 496 return;
497 } 497 }
498 } 498 }
499 }); 499 });
500 } 500 }
501 501
502 static jlong JNICALL JniGetFilterEnginePtr(JNIEnv* env, jclass clazz, jlong ptr) 502 static jlong JNICALL JniGetFilterEngineNativePtr(JNIEnv* env, jclass clazz, jlon g ptr)
503 { 503 {
504 try 504 try
505 { 505 {
506 AdblockPlus::FilterEngine& engine = GetFilterEngineRef(ptr); 506 AdblockPlus::FilterEngine& engine = GetFilterEngineRef(ptr);
507 return (jlong)&engine; 507 return (jlong)&engine;
508 } 508 }
509 CATCH_THROW_AND_RETURN(env, 0); 509 CATCH_THROW_AND_RETURN(env, 0);
510 } 510 }
511 511
512 static JNINativeMethod methods[] = 512 static JNINativeMethod methods[] =
(...skipping 19 matching lines...) Expand all
532 { (char*)"isElemhideWhitelisted", (char*)"(JLjava/lang/String;[Ljava/lang/Stri ng;)Z", (void*)JniIsElemhideWhitelisted }, 532 { (char*)"isElemhideWhitelisted", (char*)"(JLjava/lang/String;[Ljava/lang/Stri ng;)Z", (void*)JniIsElemhideWhitelisted },
533 { (char*)"getPref", (char*)"(JLjava/lang/String;)" TYP("JsValue"), (void*)JniG etPref }, 533 { (char*)"getPref", (char*)"(JLjava/lang/String;)" TYP("JsValue"), (void*)JniG etPref },
534 { (char*)"setPref", (char*)"(JLjava/lang/String;J)V", (void*)JniSetPref }, 534 { (char*)"setPref", (char*)"(JLjava/lang/String;J)V", (void*)JniSetPref },
535 { (char*)"getHostFromURL", (char*)"(JLjava/lang/String;)Ljava/lang/String;", ( void*)JniGetHostFromURL }, 535 { (char*)"getHostFromURL", (char*)"(JLjava/lang/String;)Ljava/lang/String;", ( void*)JniGetHostFromURL },
536 { (char*)"setAllowedConnectionType", (char*)"(JLjava/lang/String;)V", (void*)J niSetAllowedConnectionType }, 536 { (char*)"setAllowedConnectionType", (char*)"(JLjava/lang/String;)V", (void*)J niSetAllowedConnectionType },
537 { (char*)"getAllowedConnectionType", (char*)"(J)Ljava/lang/String;", (void*)Jn iGetAllowedConnectionType }, 537 { (char*)"getAllowedConnectionType", (char*)"(J)Ljava/lang/String;", (void*)Jn iGetAllowedConnectionType },
538 { (char*)"setAcceptableAdsEnabled", (char*)"(JZ)V", (void*)JniSetAcceptableAds Enabled }, 538 { (char*)"setAcceptableAdsEnabled", (char*)"(JZ)V", (void*)JniSetAcceptableAds Enabled },
539 { (char*)"isAcceptableAdsEnabled", (char*)"(J)Z", (void*)JniIsAcceptableAdsEna bled }, 539 { (char*)"isAcceptableAdsEnabled", (char*)"(J)Z", (void*)JniIsAcceptableAdsEna bled },
540 { (char*)"getAcceptableAdsSubscriptionURL", (char*)"(J)Ljava/lang/String;", (v oid*)JniGetAcceptableAdsSubscriptionURL }, 540 { (char*)"getAcceptableAdsSubscriptionURL", (char*)"(J)Ljava/lang/String;", (v oid*)JniGetAcceptableAdsSubscriptionURL },
541 { (char*)"updateFiltersAsync", (char*)"(JLjava/lang/String;)V", (void*)JniUpda teFiltersAsync }, 541 { (char*)"updateFiltersAsync", (char*)"(JLjava/lang/String;)V", (void*)JniUpda teFiltersAsync },
542 { (char*)"getFilterEnginePtr", (char*)"(J)J", (void*)JniGetFilterEnginePtr } 542 { (char*)"getNativePtr", (char*)"(J)J", (void*)JniGetFilterEngineNativePtr }
543 }; 543 };
544 544
545 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_FilterEngi ne_registerNatives(JNIEnv *env, jclass clazz) 545 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_FilterEngi ne_registerNatives(JNIEnv *env, jclass clazz)
546 { 546 {
547 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])); 547 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0]));
548 } 548 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld