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

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

Issue 29465639: Issue 5309 - Subscriptions update causes ANR (Closed) Base URL: github.com:abby-sergz/libadblockplus-android.git
Left Patch Set: address comments@sergz Created June 16, 2017, 11:11 a.m.
Right Patch Set: rebase Created July 5, 2017, 1:47 p.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
« no previous file with change/comment | « no previous file | libadblockplus-android/jni/JniJsEngine.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 *JniLocalReference<jstring>(env, 365 *JniLocalReference<jstring>(env,
366 static_cast<jstring>( 366 static_cast<jstring>(
367 env->GetObjectArrayElement(jArray, i))))); 367 env->GetObjectArrayElement(jArray, i)))));
368 } 368 }
369 } 369 }
370 } 370 }
371 371
372 static jobject JNICALL JniMatchesMany(JNIEnv* env, jclass clazz, jlong ptr, 372 static jobject JNICALL JniMatchesMany(JNIEnv* env, jclass clazz, jlong ptr,
373 jstring jUrl, jobject jContentType, jobjectArray jDocumentUrls) 373 jstring jUrl, jobject jContentType, jobjectArray jDocumentUrls)
374 { 374 {
375 AdblockPlus::FilterEnginePtr& engine = 375 AdblockPlus::FilterEnginePtr& engine = GetFilterEnginePtrRef(ptr);
376 GetFilterEnginePtrRef(ptr);
377 376
378 std::string url = JniJavaToStdString(env, jUrl); 377 std::string url = JniJavaToStdString(env, jUrl);
379 AdblockPlus::FilterEngine::ContentType contentType = 378 AdblockPlus::FilterEngine::ContentType contentType =
380 ConvertContentType(env, jContentType); 379 ConvertContentType(env, jContentType);
381 380
382 std::vector<std::string> documentUrls; 381 std::vector<std::string> documentUrls;
383 JavaStringArrayToStringVector(env, jDocumentUrls, documentUrls); 382 JavaStringArrayToStringVector(env, jDocumentUrls, documentUrls);
384 383
385 try 384 try
386 { 385 {
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 { (char*)"isAcceptableAdsEnabled", (char*)"(J)Z", (void*)JniIsAcceptableAdsEna bled }, 587 { (char*)"isAcceptableAdsEnabled", (char*)"(J)Z", (void*)JniIsAcceptableAdsEna bled },
589 { (char*)"getAcceptableAdsSubscriptionURL", (char*)"(J)Ljava/lang/String;", (v oid*)JniGetAcceptableAdsSubscriptionURL }, 588 { (char*)"getAcceptableAdsSubscriptionURL", (char*)"(J)Ljava/lang/String;", (v oid*)JniGetAcceptableAdsSubscriptionURL },
590 { (char*)"dtor", (char*)"(J)V", (void*)JniDtor }, 589 { (char*)"dtor", (char*)"(J)V", (void*)JniDtor },
591 { (char*)"updateFiltersAsync", (char*)"(JLjava/lang/String;)V", (void*)JniUpda teFiltersAsync } 590 { (char*)"updateFiltersAsync", (char*)"(JLjava/lang/String;)V", (void*)JniUpda teFiltersAsync }
592 }; 591 };
593 592
594 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)
595 { 594 {
596 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])); 595 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0]));
597 } 596 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld