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

Unified Diff: libadblockplus-android/jni/JniCallbacks.cpp

Issue 29678581: Issue 6000 - Rename "libadblockplus-android" (Closed)
Patch Set: addressed comments Created Jan. 29, 2018, 11:04 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « libadblockplus-android/jni/JniCallbacks.h ('k') | libadblockplus-android/jni/JniEventCallback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libadblockplus-android/jni/JniCallbacks.cpp
diff --git a/libadblockplus-android/jni/JniCallbacks.cpp b/libadblockplus-android/jni/JniCallbacks.cpp
deleted file mode 100644
index 99342fa1d397b22f2411b155330b5c7a6852232b..0000000000000000000000000000000000000000
--- a/libadblockplus-android/jni/JniCallbacks.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * This file is part of Adblock Plus <https://adblockplus.org/>,
- * Copyright (C) 2006-present eyeo GmbH
- *
- * Adblock Plus is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * Adblock Plus is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "JniCallbacks.h"
-
-// precached in JNI_OnLoad and released in JNI_OnUnload
-JniGlobalReference<jclass>* exceptionHandlerClass;
-
-void JniCallbacks_OnLoad(JavaVM* vm, JNIEnv* env, void* reserved)
-{
- exceptionHandlerClass = new JniGlobalReference<jclass>(env, env->FindClass(PKG("JniExceptionHandler")));
-}
-
-void JniCallbacks_OnUnload(JavaVM* vm, JNIEnv* env, void* reserved)
-{
- if (exceptionHandlerClass)
- {
- delete exceptionHandlerClass;
- exceptionHandlerClass = NULL;
- }
-}
-
-JniCallbackBase::JniCallbackBase(JNIEnv* env, jobject callbackObject)
- : callbackObject(new JniGlobalReference<jobject>(env, callbackObject))
-{
- env->GetJavaVM(&javaVM);
-}
-
-JniCallbackBase::~JniCallbackBase()
-{
-
-}
-
-void JniCallbackBase::LogException(JNIEnv* env, jthrowable throwable) const
-{
- jmethodID logMethod = env->GetStaticMethodID(
- exceptionHandlerClass->Get(), "logException", "(Ljava/lang/Throwable;)V");
- if (logMethod)
- {
- env->CallStaticVoidMethod(exceptionHandlerClass->Get(), logMethod, throwable);
- }
-}
-
-void JniCallbackBase::CheckAndLogJavaException(JNIEnv* env) const
-{
- if (env->ExceptionCheck())
- {
- JniLocalReference<jthrowable> throwable(env, env->ExceptionOccurred());
- env->ExceptionClear();
- LogException(env, *throwable);
- }
-}
« no previous file with comments | « libadblockplus-android/jni/JniCallbacks.h ('k') | libadblockplus-android/jni/JniEventCallback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld