mirror of
https://github.com/status-im/react-native.git
synced 2025-02-13 09:56:44 +00:00
Let jsc know it will run web worker
Reviewed By: astreet Differential Revision: D3287543 fbshipit-source-id: 2a9de938feec417aef34c0ff26f138730b32929f
This commit is contained in:
parent
44bf85a041
commit
cd691e2cc2
@ -392,10 +392,13 @@ int JSCExecutor::addWebWorker(
|
||||
|
||||
Object globalObj = Value(m_context, globalObjRef).asObject();
|
||||
|
||||
auto workerJscConfig = m_jscConfig;
|
||||
workerJscConfig["isWebWorker"] = true;
|
||||
|
||||
auto workerMQT = WebWorkerUtil::createWebWorkerThread(workerId, m_messageQueueThread.get());
|
||||
std::unique_ptr<JSCExecutor> worker;
|
||||
workerMQT->runOnQueueSync([this, &worker, &script, &globalObj, workerId] () {
|
||||
worker.reset(new JSCExecutor(m_bridge, workerId, this, script, globalObj.toJSONMap(), m_jscConfig));
|
||||
workerMQT->runOnQueueSync([this, &worker, &script, &globalObj, workerId, &workerJscConfig] () {
|
||||
worker.reset(new JSCExecutor(m_bridge, workerId, this, script, globalObj.toJSONMap(), workerJscConfig));
|
||||
});
|
||||
|
||||
Object workerObj = Value(m_context, workerRef).asObject();
|
||||
|
@ -320,12 +320,15 @@ int JSCExecutor::addWebWorker(
|
||||
|
||||
Object globalObj = Value(m_context, globalObjRef).asObject();
|
||||
|
||||
auto workerJscConfig = m_jscConfig;
|
||||
workerJscConfig["isWebWorker"] = true;
|
||||
|
||||
std::shared_ptr<MessageQueueThread> workerMQT =
|
||||
WebWorkerUtil::createWebWorkerThread(workerId, m_messageQueueThread.get());
|
||||
std::unique_ptr<JSCExecutor> worker;
|
||||
workerMQT->runOnQueueSync([this, &worker, &workerMQT, &script, &globalObj, workerId] () {
|
||||
workerMQT->runOnQueueSync([this, &worker, &workerMQT, &script, &globalObj, workerId, &workerJscConfig] () {
|
||||
worker.reset(new JSCExecutor(m_bridge, workerMQT, workerId, this, script,
|
||||
globalObj.toJSONMap(), m_jscConfig));
|
||||
globalObj.toJSONMap(), workerJscConfig));
|
||||
});
|
||||
|
||||
Object workerObj = Value(m_context, workerRef).asObject();
|
||||
|
Loading…
x
Reference in New Issue
Block a user