Remove additional JSON encoding for native->JS communication

Reviewed By: mhorowitz

Differential Revision: D3857323

fbshipit-source-id: 4386cc107b8a1425ecb7297b0f659f6c47f01a78
This commit is contained in:
Pieter De Baets
2016-09-19 04:43:09 -07:00
committed by Facebook Github Bot 2
parent bd4cd6ea5d
commit 145109fc6d
16 changed files with 224 additions and 100 deletions

View File

@@ -58,9 +58,6 @@ ProxyExecutor::ProxyExecutor(jni::global_ref<jobject>&& executorInstance,
setGlobalVariable(
"__fbBatchedBridgeConfig",
folly::make_unique<JSBigStdString>(detail::toStdString(folly::toJson(config))));
setGlobalVariable(
"__fbBatchedBridgeSerializeNativeParams",
folly::make_unique<JSBigStdString>("1"));
}
ProxyExecutor::~ProxyExecutor() {
@@ -95,7 +92,7 @@ void ProxyExecutor::callFunction(const std::string& moduleId, const std::string&
std::move(arguments),
};
std::string result = executeJSCallWithProxy(m_executor.get(), "callFunctionReturnFlushedQueue", std::move(call));
m_delegate->callNativeModules(*this, result, true);
m_delegate->callNativeModules(*this, folly::parseJson(result), true);
}
void ProxyExecutor::invokeCallback(const double callbackId, const folly::dynamic& arguments) {
@@ -104,7 +101,7 @@ void ProxyExecutor::invokeCallback(const double callbackId, const folly::dynamic
std::move(arguments)
};
std::string result = executeJSCallWithProxy(m_executor.get(), "invokeCallbackAndReturnFlushedQueue", std::move(call));
m_delegate->callNativeModules(*this, result, true);
m_delegate->callNativeModules(*this, folly::parseJson(result), true);
}
void ProxyExecutor::setGlobalVariable(std::string propName,