Support sync loading of the initial bundle/source

Reviewed By: javache

Differential Revision: D3897521

fbshipit-source-id: a4f234c7003a5f4be952d315eb62f382836e24dc
This commit is contained in:
Marc Horowitz
2016-09-26 16:01:42 -07:00
committed by Facebook Github Bot 7
parent 51df83d7d5
commit 6071e8ca2c
4 changed files with 54 additions and 4 deletions

View File

@@ -44,9 +44,12 @@ public:
class JsToNativeBridge;
// This class manages calls from native code to JS. It also manages
// executors and their threads. This part is used by both bridges for
// now, but further refactorings should separate the bridges more
// fully #11247981.
// executors and their threads. All functions here can be called from
// any thread.
//
// Except for loadApplicationScriptSync(), all void methods will queue
// work to run on the jsQueue passed to the ctor, and return
// immediately.
class NativeToJsBridge {
public:
friend class JsToNativeBridge;
@@ -86,6 +89,10 @@ public:
std::unique_ptr<JSModulesUnbundle> unbundle,
std::unique_ptr<const JSBigString> startupCode,
std::string sourceURL);
void loadApplicationSync(
std::unique_ptr<JSModulesUnbundle> unbundle,
std::unique_ptr<const JSBigString> startupCode,
std::string sourceURL);
/**
* Similar to loading a "bundle", but instead of passing js source this method accepts