LEFT | RIGHT |
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 env->CallVoidMethod(GetCallbackObject(), method, *jFromPath, *jToPath); | 96 env->CallVoidMethod(GetCallbackObject(), method, *jFromPath, *jToPath); |
97 CheckAndLogJavaException(*env); | 97 CheckAndLogJavaException(*env); |
98 } | 98 } |
99 | 99 |
100 void JniFileSystemCallback::Remove(const std::string& path) | 100 void JniFileSystemCallback::Remove(const std::string& path) |
101 { | 101 { |
102 JNIEnvAcquire env(GetJavaVM()); | 102 JNIEnvAcquire env(GetJavaVM()); |
103 | 103 |
104 jmethodID method = env->GetMethodID( | 104 jmethodID method = env->GetMethodID( |
105 *JniLocalReference<jclass>(*env, env->GetObjectClass(GetCallbackObject())), | 105 *JniLocalReference<jclass>(*env, env->GetObjectClass(GetCallbackObject())), |
106 "move", | 106 "remove", |
107 "(Ljava/lang/String;Ljava/lang/String;)V"); | 107 "(Ljava/lang/String;)V"); |
108 | 108 |
109 JniLocalReference<jstring> jPath(*env, env->NewStringUTF(path.c_str())); | 109 JniLocalReference<jstring> jPath(*env, env->NewStringUTF(path.c_str())); |
110 | 110 |
111 env->CallVoidMethod(GetCallbackObject(), method, *jPath); | 111 env->CallVoidMethod(GetCallbackObject(), method, *jPath); |
112 CheckAndLogJavaException(*env); | 112 CheckAndLogJavaException(*env); |
113 } | 113 } |
114 | 114 |
115 AdblockPlus::FileSystem::StatResult JniFileSystemCallback::Stat(const std::strin
g& path) const | 115 AdblockPlus::FileSystem::StatResult JniFileSystemCallback::Stat(const std::strin
g& path) const |
116 { | 116 { |
117 JNIEnvAcquire env(GetJavaVM()); | 117 JNIEnvAcquire env(GetJavaVM()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 static JNINativeMethod methods[] = | 174 static JNINativeMethod methods[] = |
175 { | 175 { |
176 { (char*)"ctor", (char*)"(Ljava/lang/Object;)J", (void*)JniCtor }, | 176 { (char*)"ctor", (char*)"(Ljava/lang/Object;)J", (void*)JniCtor }, |
177 { (char*)"dtor", (char*)"(J)V", (void*)JniDtor } | 177 { (char*)"dtor", (char*)"(J)V", (void*)JniDtor } |
178 }; | 178 }; |
179 | 179 |
180 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_FileSystem
_registerNatives(JNIEnv *env, jclass clazz) | 180 extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_FileSystem
_registerNatives(JNIEnv *env, jclass clazz) |
181 { | 181 { |
182 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])); | 182 env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])); |
183 } | 183 } |
LEFT | RIGHT |