Index: libadblockplus-android/jni/JniJsEngine.cpp |
diff --git a/libadblockplus-android/jni/JniJsEngine.cpp b/libadblockplus-android/jni/JniJsEngine.cpp |
index d30cb3376830a5ea43fea013a4e6c4b08b58bea4..26ae5edde9232c9417fbf8334e98798f9a663c78 100644 |
--- a/libadblockplus-android/jni/JniJsEngine.cpp |
+++ b/libadblockplus-android/jni/JniJsEngine.cpp |
@@ -136,6 +136,19 @@ static void JNICALL JniSetDefaultFileSystem(JNIEnv* env, jclass clazz, jlong ptr |
CATCH_AND_THROW(env) |
} |
+static void JNICALL JniSetFileSystem(JNIEnv* env, jclass clazz, jlong ptr, jlong fileSystemPtr) |
+{ |
+ AdblockPlus::JsEnginePtr& engine = *JniLongToTypePtr<AdblockPlus::JsEnginePtr>(ptr); |
+ |
+ try |
+ { |
+ AdblockPlus::FileSystemPtr fileSystem(JniLongToTypePtr<JniFileSystemCallback>(fileSystemPtr)); |
+ |
+ engine->SetFileSystem(fileSystem); |
+ } |
+ CATCH_AND_THROW(env) |
+} |
+ |
static void JNICALL JniSetDefaultWebRequest(JNIEnv* env, jclass clazz, jlong ptr) |
{ |
AdblockPlus::JsEnginePtr& engine = *JniLongToTypePtr<AdblockPlus::JsEnginePtr>(ptr); |
@@ -242,6 +255,7 @@ static JNINativeMethod methods[] = |
{ (char*)"evaluate", (char*)"(JLjava/lang/String;Ljava/lang/String;)" TYP("JsValue"), (void*)JniEvaluate }, |
+ { (char*)"setFileSystem", (char*)"(JJ)V", (void*)JniSetFileSystem }, |
{ (char*)"setDefaultFileSystem", (char*)"(JLjava/lang/String;)V", (void*)JniSetDefaultFileSystem }, |
{ (char*)"setLogSystem", (char*)"(JJ)V", (void*)JniSetLogSystem }, |
{ (char*)"setDefaultLogSystem", (char*)"(J)V", (void*)JniSetDefaultLogSystem }, |