Remove unused PersistentDirectory JSC config

Reviewed By: amnn

Differential Revision: D4921075

fbshipit-source-id: 8e0a0caadc882a0e3ffb6f66c2bc7336c7d64849
This commit is contained in:
Pieter De Baets 2017-04-20 03:09:42 -07:00 committed by Facebook Github Bot
parent 79d9fd8f83
commit 366cb5a00a
1 changed files with 2 additions and 11 deletions

View File

@ -34,7 +34,7 @@ namespace react {
namespace {
static std::string getApplicationDir(const char* methodName) {
static std::string getApplicationCacheDir(void) {
// Get the Application Context object
auto getApplicationClass = findClassLocal(
"com/facebook/react/common/ApplicationHolder");
@ -46,7 +46,7 @@ static std::string getApplicationDir(const char* methodName) {
// Get getCacheDir() from the context
auto getDirMethod = findClassLocal("android/app/Application")
->getMethod<jobject()>(methodName,
->getMethod<jobject()>("getCacheDir",
"()Ljava/io/File;"
);
auto dirObj = getDirMethod(application);
@ -57,14 +57,6 @@ static std::string getApplicationDir(const char* methodName) {
return getAbsolutePathMethod(dirObj)->toStdString();
}
static std::string getApplicationCacheDir() {
return getApplicationDir("getCacheDir");
}
static std::string getApplicationPersistentDir() {
return getApplicationDir("getFilesDir");
}
static JSValueRef nativePerformanceNow(
JSContextRef ctx,
JSObjectRef function,
@ -95,7 +87,6 @@ class JSCJavaScriptExecutorHolder : public HybridClass<JSCJavaScriptExecutorHold
static local_ref<jhybriddata> initHybrid(alias_ref<jclass>, ReadableNativeArray* jscConfigArray) {
// See JSCJavaScriptExecutor.Factory() for the other side of this hack.
folly::dynamic jscConfigMap = jscConfigArray->consume()[0];
jscConfigMap["PersistentDirectory"] = getApplicationPersistentDir();
return makeCxxInstance(
std::make_shared<JSCExecutorFactory>(getApplicationCacheDir(), std::move(jscConfigMap)));
}