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

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

Issue 29435570: Issue 5205 - Add Subscription.isDisabled() (Closed)
Left Patch Set: removed casting Created May 22, 2017, 11:33 a.m.
Right Patch Set: removed one more [unnecessary] casting Created May 26, 2017, 5:50 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-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 19 matching lines...) Expand all
30 { 30 {
31 return GetSubscriptionPtr(ptr)->IsDisabled() ? JNI_TRUE : JNI_FALSE; 31 return GetSubscriptionPtr(ptr)->IsDisabled() ? JNI_TRUE : JNI_FALSE;
32 } 32 }
33 CATCH_THROW_AND_RETURN(env, JNI_FALSE) 33 CATCH_THROW_AND_RETURN(env, JNI_FALSE)
34 } 34 }
35 35
36 static void JNICALL JniSetDisabled(JNIEnv* env, jclass clazz, jlong ptr, jboolea n disabled) 36 static void JNICALL JniSetDisabled(JNIEnv* env, jclass clazz, jlong ptr, jboolea n disabled)
37 { 37 {
38 try 38 try
39 { 39 {
40 return GetSubscriptionPtr(ptr)->SetDisabled((bool)(disabled == JNI_TRUE)); 40 return GetSubscriptionPtr(ptr)->SetDisabled(disabled == JNI_TRUE);
41 } 41 }
42 CATCH_AND_THROW(env) 42 CATCH_AND_THROW(env)
43 } 43 }
44 44
45 static jboolean JNICALL JniIsListed(JNIEnv* env, jclass clazz, jlong ptr) 45 static jboolean JNICALL JniIsListed(JNIEnv* env, jclass clazz, jlong ptr)
46 { 46 {
47 try 47 try
48 { 48 {
49 return GetSubscriptionPtr(ptr)->IsListed() ? JNI_TRUE : JNI_FALSE; 49 return GetSubscriptionPtr(ptr)->IsListed() ? JNI_TRUE : JNI_FALSE;
50 } 50 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 { (char*)"updateFilters", (char*)"(J)V", (void*)JniUpdateFilters }, 118 { (char*)"updateFilters", (char*)"(J)V", (void*)JniUpdateFilters },
119 { (char*)"isUpdating", (char*)"(J)Z", (void*)JniIsUpdating }, 119 { (char*)"isUpdating", (char*)"(J)Z", (void*)JniIsUpdating },
120 { (char*)"operatorEquals", (char*)"(JJ)Z", (void*)JniOperatorEquals }, 120 { (char*)"operatorEquals", (char*)"(JJ)Z", (void*)JniOperatorEquals },
121 { (char*)"isAcceptableAds", (char*)"(J)Z", (void*)JniIsAcceptableAds }, 121 { (char*)"isAcceptableAds", (char*)"(J)Z", (void*)JniIsAcceptableAds },
122 }; 122 };
123 123
124 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_Subscripti on_registerNatives(JNIEnv *env, jclass clazz) 124 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_Subscripti on_registerNatives(JNIEnv *env, jclass clazz)
125 { 125 {
126 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])); 126 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0]));
127 } 127 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld