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

Side by Side Diff: libadblockplus-android/jni/Utils.h

Issue 29345369: Issue 4081 - Fix failing MockWebRequestTest test for libadblockplus-android (Closed)
Patch Set: with Utils' JniJavaToStdString Created June 21, 2016, 9:04 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 inline int32_t JniGetIntField(JNIEnv* env, jclass clazz, jobject jObj, const cha r* name) 164 inline int32_t JniGetIntField(JNIEnv* env, jclass clazz, jobject jObj, const cha r* name)
165 { 165 {
166 return (int32_t)env->GetIntField(jObj, env->GetFieldID(clazz, name, "I")); 166 return (int32_t)env->GetIntField(jObj, env->GetFieldID(clazz, name, "I"));
167 } 167 }
168 168
169 inline int64_t JniGetLongField(JNIEnv* env, jclass clazz, jobject jObj, const ch ar* name) 169 inline int64_t JniGetLongField(JNIEnv* env, jclass clazz, jobject jObj, const ch ar* name)
170 { 170 {
171 return (int64_t)env->GetLongField(jObj, env->GetFieldID(clazz, name, "J")); 171 return (int64_t)env->GetLongField(jObj, env->GetFieldID(clazz, name, "J"));
172 } 172 }
173 173
174 inline jobjectArray JniGetStringArrayField(JNIEnv* env, jclass clazz, jobject jO bj, const char* name)
175 {
176 return (jobjectArray)env->GetObjectField(jObj, env->GetFieldID(clazz, name, "[ Ljava/lang/String;"));
177 }
178
174 jobject NewJniArrayList(JNIEnv* env); 179 jobject NewJniArrayList(JNIEnv* env);
175 180
176 jobject NewJniFilter(JNIEnv* env, const AdblockPlus::FilterPtr& filter); 181 jobject NewJniFilter(JNIEnv* env, const AdblockPlus::FilterPtr& filter);
177 182
178 jobject NewJniSubscription(JNIEnv* env, 183 jobject NewJniSubscription(JNIEnv* env,
179 const AdblockPlus::SubscriptionPtr& subscription); 184 const AdblockPlus::SubscriptionPtr& subscription);
180 185
181 jobject NewJniNotification(JNIEnv* env, 186 jobject NewJniNotification(JNIEnv* env,
182 const AdblockPlus::NotificationPtr& notification); 187 const AdblockPlus::NotificationPtr& notification);
183 188
(...skipping 13 matching lines...) Expand all
197 JniThrowException(jEnv, except); \ 202 JniThrowException(jEnv, except); \
198 return retVal; \ 203 return retVal; \
199 } \ 204 } \
200 catch (...) \ 205 catch (...) \
201 { \ 206 { \
202 JniThrowException(jEnv); \ 207 JniThrowException(jEnv); \
203 return retVal; \ 208 return retVal; \
204 } 209 }
205 210
206 #endif 211 #endif
OLDNEW
« libadblockplus-android/jni/JniWebRequest.cpp ('K') | « libadblockplus-android/jni/JniWebRequest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld