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:44:12 -07:00
committed by Facebook Github Bot 2
parent bd4cd6ea5d
commit 145109fc6d
16 changed files with 224 additions and 100 deletions
+3 -3
View File
@@ -53,13 +53,13 @@ public:
}
void callNativeModules(
JSExecutor& executor, std::string callJSON, bool isEndOfBatch) override {
JSExecutor& executor, folly::dynamic&& calls, bool isEndOfBatch) override {
ExecutorToken token = m_nativeToJs->getTokenForExecutor(executor);
m_nativeQueue->runOnQueue([this, token, callJSON=std::move(callJSON), isEndOfBatch] {
m_nativeQueue->runOnQueue([this, token, calls=std::move(calls), isEndOfBatch] () mutable {
// An exception anywhere in here stops processing of the batch. This
// was the behavior of the Android bridge, and since exception handling
// terminates the whole bridge, there's not much point in continuing.
for (auto& call : react::parseMethodCalls(callJSON)) {
for (auto& call : react::parseMethodCalls(std::move(calls))) {
m_registry->callNativeMethod(
token, call.moduleId, call.methodId, std::move(call.arguments), call.callId);
}