mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Let jsc know it will run web worker
Reviewed By: astreet Differential Revision: D3287543 fbshipit-source-id: 2a9de938feec417aef34c0ff26f138730b32929f
This commit is contained in:
committed by
Facebook Github Bot 3
parent
44bf85a041
commit
cd691e2cc2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user