Make runJSBundle synchronous
Summary: This is called on the JS thread so we don't need to post a runnable. Reviewed By: lexs Differential Revision: D3281388 fbshipit-source-id: ff292a710442c0b84c6ee31a2644a5c2ea650dc9
This commit is contained in:
parent
1c31aea83f
commit
f1d12f6b38
|
@ -35,21 +35,14 @@ Bridge::~Bridge() {
|
|||
}
|
||||
|
||||
void Bridge::loadApplicationScript(const std::string& script, const std::string& sourceURL) {
|
||||
runOnExecutorQueue(*m_mainExecutorToken, [=] (JSExecutor* executor) {
|
||||
executor->loadApplicationScript(script, sourceURL);
|
||||
});
|
||||
m_mainExecutor->loadApplicationScript(script, sourceURL);
|
||||
}
|
||||
|
||||
void Bridge::loadApplicationUnbundle(
|
||||
std::unique_ptr<JSModulesUnbundle> unbundle,
|
||||
const std::string& startupCode,
|
||||
const std::string& sourceURL) {
|
||||
runOnExecutorQueue(
|
||||
*m_mainExecutorToken,
|
||||
[holder=std::make_shared<std::unique_ptr<JSModulesUnbundle>>(std::move(unbundle)), startupCode, sourceURL]
|
||||
(JSExecutor* executor) mutable {
|
||||
executor->loadApplicationUnbundle(std::move(*holder), startupCode, sourceURL);
|
||||
});
|
||||
m_mainExecutor->loadApplicationUnbundle(std::move(unbundle), startupCode, sourceURL);
|
||||
}
|
||||
|
||||
void Bridge::callFunction(
|
||||
|
|
Loading…
Reference in New Issue