Configure JSExector with BundleRegistry instead of JSModulesUnbundle.

Differential Revision: D5850968

fbshipit-source-id: e5e7ad92c2347c2641551fcf820f061ffde5fed6
This commit is contained in:
Alex Dvornikov 2017-09-21 08:34:46 -07:00 committed by Facebook Github Bot
parent 2f952fbaac
commit 79821917fa
16 changed files with 71 additions and 49 deletions

View File

@ -36,6 +36,7 @@
#import <cxxreact/JSCExecutor.h> #import <cxxreact/JSCExecutor.h>
#import <cxxreact/JSIndexedRAMBundle.h> #import <cxxreact/JSIndexedRAMBundle.h>
#import <cxxreact/Platform.h> #import <cxxreact/Platform.h>
#import <cxxreact/RAMBundleRegistry.h>
#import <jschelpers/Value.h> #import <jschelpers/Value.h>
#import "NSDataBigString.h" #import "NSDataBigString.h"
@ -1184,7 +1185,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR
[self->_performanceLogger markStopForTag:RCTPLRAMBundleLoad]; [self->_performanceLogger markStopForTag:RCTPLRAMBundleLoad];
[self->_performanceLogger setValue:scriptStr->size() forTag:RCTPLRAMStartupCodeSize]; [self->_performanceLogger setValue:scriptStr->size() forTag:RCTPLRAMStartupCodeSize];
if (self->_reactInstance) { if (self->_reactInstance) {
self->_reactInstance->loadUnbundle(std::move(ramBundle), std::move(scriptStr), auto registry = std::make_unique<RAMBundleRegistry>(std::move(ramBundle));
self->_reactInstance->loadRAMBundle(std::move(registry), std::move(scriptStr),
sourceUrlStr.UTF8String, !async); sourceUrlStr.UTF8String, !async);
} }
} else if (self->_reactInstance) { } else if (self->_reactInstance) {

View File

@ -91,8 +91,8 @@ public:
}]; }];
} }
void setJSModulesUnbundle(std::unique_ptr<JSModulesUnbundle>) override { void setBundleRegistry(std::unique_ptr<RAMBundleRegistry>) override {
RCTAssert(NO, @"Unbundle is not supported in RCTObjcExecutor"); RCTAssert(NO, @"RAM bundles are not supported in RCTObjcExecutor");
} }
void callFunction(const std::string &module, const std::string &method, void callFunction(const std::string &module, const std::string &method,

View File

@ -1101,6 +1101,7 @@
C6194AB11EF156280034D062 /* RCTPackagerConnectionConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = C6194AAB1EF156280034D062 /* RCTPackagerConnectionConfig.h */; }; C6194AB11EF156280034D062 /* RCTPackagerConnectionConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = C6194AAB1EF156280034D062 /* RCTPackagerConnectionConfig.h */; };
C654505E1F3BD9280090799B /* RCTManagedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = C654505D1F3BD9280090799B /* RCTManagedPointer.h */; }; C654505E1F3BD9280090799B /* RCTManagedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = C654505D1F3BD9280090799B /* RCTManagedPointer.h */; };
C654505F1F3BD9280090799B /* RCTManagedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = C654505D1F3BD9280090799B /* RCTManagedPointer.h */; }; C654505F1F3BD9280090799B /* RCTManagedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = C654505D1F3BD9280090799B /* RCTManagedPointer.h */; };
C669D8981F72E3DE006748EB /* RAMBundleRegistry.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = C6D380181F71D75B00621378 /* RAMBundleRegistry.h */; };
C6827DF61EF17CCC00D66BEF /* RCTJSEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = C6827DF51EF17CCC00D66BEF /* RCTJSEnvironment.h */; }; C6827DF61EF17CCC00D66BEF /* RCTJSEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = C6827DF51EF17CCC00D66BEF /* RCTJSEnvironment.h */; };
C6827DF71EF17CCC00D66BEF /* RCTJSEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = C6827DF51EF17CCC00D66BEF /* RCTJSEnvironment.h */; }; C6827DF71EF17CCC00D66BEF /* RCTJSEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = C6827DF51EF17CCC00D66BEF /* RCTJSEnvironment.h */; };
C6827DFB1EF1800E00D66BEF /* RCTJSEnvironment.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = C6827DF51EF17CCC00D66BEF /* RCTJSEnvironment.h */; }; C6827DFB1EF1800E00D66BEF /* RCTJSEnvironment.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = C6827DF51EF17CCC00D66BEF /* RCTJSEnvironment.h */; };
@ -1608,6 +1609,7 @@
dstPath = include/cxxreact; dstPath = include/cxxreact;
dstSubfolderSpec = 16; dstSubfolderSpec = 16;
files = ( files = (
C669D8981F72E3DE006748EB /* RAMBundleRegistry.h in Copy Headers */,
3DA981A01E5B0E34004F2374 /* CxxModule.h in Copy Headers */, 3DA981A01E5B0E34004F2374 /* CxxModule.h in Copy Headers */,
3DA981A11E5B0E34004F2374 /* CxxNativeModule.h in Copy Headers */, 3DA981A11E5B0E34004F2374 /* CxxNativeModule.h in Copy Headers */,
3DA981A21E5B0E34004F2374 /* JSExecutor.h in Copy Headers */, 3DA981A21E5B0E34004F2374 /* JSExecutor.h in Copy Headers */,

View File

@ -13,6 +13,7 @@
#include <cxxreact/MethodCall.h> #include <cxxreact/MethodCall.h>
#include <cxxreact/RecoverableError.h> #include <cxxreact/RecoverableError.h>
#include <cxxreact/ModuleRegistry.h> #include <cxxreact/ModuleRegistry.h>
#include <cxxreact/RAMBundleRegistry.h>
#include <fb/log.h> #include <fb/log.h>
#include <folly/dynamic.h> #include <folly/dynamic.h>
#include <folly/Memory.h> #include <folly/Memory.h>
@ -185,8 +186,10 @@ void CatalystInstanceImpl::jniLoadScriptFromAssets(
auto manager = extractAssetManager(assetManager); auto manager = extractAssetManager(assetManager);
auto script = loadScriptFromAssets(manager, sourceURL); auto script = loadScriptFromAssets(manager, sourceURL);
if (JniJSModulesUnbundle::isUnbundle(manager, sourceURL)) { if (JniJSModulesUnbundle::isUnbundle(manager, sourceURL)) {
instance_->loadUnbundle( auto bundle = folly::make_unique<JniJSModulesUnbundle>(manager, sourceURL);
folly::make_unique<JniJSModulesUnbundle>(manager, sourceURL), auto registry = folly::make_unique<RAMBundleRegistry>(std::move(bundle));
instance_->loadRAMBundle(
std::move(registry),
std::move(script), std::move(script),
sourceURL, sourceURL,
loadSynchronously); loadSynchronously);
@ -214,8 +217,9 @@ void CatalystInstanceImpl::jniLoadScriptFromFile(const std::string& fileName,
if (isIndexedRAMBundle(zFileName)) { if (isIndexedRAMBundle(zFileName)) {
auto bundle = folly::make_unique<JSIndexedRAMBundle>(zFileName); auto bundle = folly::make_unique<JSIndexedRAMBundle>(zFileName);
auto startupScript = bundle->getStartupCode(); auto startupScript = bundle->getStartupCode();
instance_->loadUnbundle( auto registry = folly::make_unique<RAMBundleRegistry>(std::move(bundle));
std::move(bundle), instance_->loadRAMBundle(
std::move(registry),
std::move(startupScript), std::move(startupScript),
sourceURL, sourceURL,
loadSynchronously); loadSynchronously);

View File

@ -84,10 +84,10 @@ void ProxyExecutor::loadApplicationScript(
// we launch the application. // we launch the application.
} }
void ProxyExecutor::setJSModulesUnbundle(std::unique_ptr<JSModulesUnbundle>) { void ProxyExecutor::setBundleRegistry(std::unique_ptr<RAMBundleRegistry>) {
jni::throwNewJavaException( jni::throwNewJavaException(
"java/lang/UnsupportedOperationException", "java/lang/UnsupportedOperationException",
"Loading application unbundles is not supported for proxy executors"); "Loading application RAM bundles is not supported for proxy executors");
} }
void ProxyExecutor::callFunction(const std::string& moduleId, const std::string& methodId, const folly::dynamic& arguments) { void ProxyExecutor::callFunction(const std::string& moduleId, const std::string& methodId, const folly::dynamic& arguments) {

View File

@ -35,8 +35,8 @@ public:
virtual void loadApplicationScript( virtual void loadApplicationScript(
std::unique_ptr<const JSBigString> script, std::unique_ptr<const JSBigString> script,
std::string sourceURL) override; std::string sourceURL) override;
virtual void setJSModulesUnbundle( virtual void setBundleRegistry(
std::unique_ptr<JSModulesUnbundle> bundle) override; std::unique_ptr<RAMBundleRegistry> bundle) override;
virtual void callFunction( virtual void callFunction(
const std::string& moduleId, const std::string& moduleId,
const std::string& methodId, const std::string& methodId,

View File

@ -87,6 +87,7 @@ CXXREACT_PUBLIC_HEADERS = [
"NativeModule.h", "NativeModule.h",
"NativeToJsBridge.h", "NativeToJsBridge.h",
"Platform.h", "Platform.h",
"RAMBundleRegistry.h",
"RecoverableError.h", "RecoverableError.h",
"SharedProxyCxxModule.h", "SharedProxyCxxModule.h",
"SystraceSection.h", "SystraceSection.h",

View File

@ -4,10 +4,10 @@
#include "JSBigString.h" #include "JSBigString.h"
#include "JSExecutor.h" #include "JSExecutor.h"
#include "JSModulesUnbundle.h"
#include "MessageQueueThread.h" #include "MessageQueueThread.h"
#include "MethodCall.h" #include "MethodCall.h"
#include "NativeToJsBridge.h" #include "NativeToJsBridge.h"
#include "RAMBundleRegistry.h"
#include "RecoverableError.h" #include "RecoverableError.h"
#include "SystraceSection.h" #include "SystraceSection.h"
@ -50,17 +50,17 @@ void Instance::initializeBridge(
CHECK(nativeToJsBridge_); CHECK(nativeToJsBridge_);
} }
void Instance::loadApplication(std::unique_ptr<JSModulesUnbundle> unbundle, void Instance::loadApplication(std::unique_ptr<RAMBundleRegistry> bundleRegistry,
std::unique_ptr<const JSBigString> string, std::unique_ptr<const JSBigString> string,
std::string sourceURL) { std::string sourceURL) {
callback_->incrementPendingJSCalls(); callback_->incrementPendingJSCalls();
SystraceSection s("Instance::loadApplication", "sourceURL", SystraceSection s("Instance::loadApplication", "sourceURL",
sourceURL); sourceURL);
nativeToJsBridge_->loadApplication(std::move(unbundle), std::move(string), nativeToJsBridge_->loadApplication(std::move(bundleRegistry), std::move(string),
std::move(sourceURL)); std::move(sourceURL));
} }
void Instance::loadApplicationSync(std::unique_ptr<JSModulesUnbundle> unbundle, void Instance::loadApplicationSync(std::unique_ptr<RAMBundleRegistry> bundleRegistry,
std::unique_ptr<const JSBigString> string, std::unique_ptr<const JSBigString> string,
std::string sourceURL) { std::string sourceURL) {
std::unique_lock<std::mutex> lock(m_syncMutex); std::unique_lock<std::mutex> lock(m_syncMutex);
@ -68,7 +68,7 @@ void Instance::loadApplicationSync(std::unique_ptr<JSModulesUnbundle> unbundle,
SystraceSection s("Instance::loadApplicationSync", "sourceURL", SystraceSection s("Instance::loadApplicationSync", "sourceURL",
sourceURL); sourceURL);
nativeToJsBridge_->loadApplicationSync(std::move(unbundle), std::move(string), nativeToJsBridge_->loadApplicationSync(std::move(bundleRegistry), std::move(string),
std::move(sourceURL)); std::move(sourceURL));
} }
@ -91,15 +91,15 @@ void Instance::loadScriptFromString(std::unique_ptr<const JSBigString> string,
} }
} }
void Instance::loadUnbundle(std::unique_ptr<JSModulesUnbundle> unbundle, void Instance::loadRAMBundle(std::unique_ptr<RAMBundleRegistry> bundleRegistry,
std::unique_ptr<const JSBigString> startupScript, std::unique_ptr<const JSBigString> startupScript,
std::string startupScriptSourceURL, std::string startupScriptSourceURL,
bool loadSynchronously) { bool loadSynchronously) {
if (loadSynchronously) { if (loadSynchronously) {
loadApplicationSync(std::move(unbundle), std::move(startupScript), loadApplicationSync(std::move(bundleRegistry), std::move(startupScript),
std::move(startupScriptSourceURL)); std::move(startupScriptSourceURL));
} else { } else {
loadApplication(std::move(unbundle), std::move(startupScript), loadApplication(std::move(bundleRegistry), std::move(startupScript),
std::move(startupScriptSourceURL)); std::move(startupScriptSourceURL));
} }
} }

View File

@ -21,9 +21,9 @@ namespace react {
class JSBigString; class JSBigString;
class JSExecutorFactory; class JSExecutorFactory;
class JSModulesUnbundle;
class MessageQueueThread; class MessageQueueThread;
class ModuleRegistry; class ModuleRegistry;
class RAMBundleRegistry;
struct InstanceCallback { struct InstanceCallback {
virtual ~InstanceCallback() {} virtual ~InstanceCallback() {}
@ -44,7 +44,7 @@ public:
void loadScriptFromString(std::unique_ptr<const JSBigString> string, void loadScriptFromString(std::unique_ptr<const JSBigString> string,
std::string sourceURL, bool loadSynchronously); std::string sourceURL, bool loadSynchronously);
void loadUnbundle(std::unique_ptr<JSModulesUnbundle> unbundle, void loadRAMBundle(std::unique_ptr<RAMBundleRegistry> bundleRegistry,
std::unique_ptr<const JSBigString> startupScript, std::unique_ptr<const JSBigString> startupScript,
std::string startupScriptSourceURL, bool loadSynchronously); std::string startupScriptSourceURL, bool loadSynchronously);
bool supportsProfiling(); bool supportsProfiling();
@ -73,10 +73,10 @@ public:
private: private:
void callNativeModules(folly::dynamic &&calls, bool isEndOfBatch); void callNativeModules(folly::dynamic &&calls, bool isEndOfBatch);
void loadApplication(std::unique_ptr<JSModulesUnbundle> unbundle, void loadApplication(std::unique_ptr<RAMBundleRegistry> bundleRegistry,
std::unique_ptr<const JSBigString> startupScript, std::unique_ptr<const JSBigString> startupScript,
std::string startupScriptSourceURL); std::string startupScriptSourceURL);
void loadApplicationSync(std::unique_ptr<JSModulesUnbundle> unbundle, void loadApplicationSync(std::unique_ptr<RAMBundleRegistry> bundleRegistry,
std::unique_ptr<const JSBigString> startupScript, std::unique_ptr<const JSBigString> startupScript,
std::string startupScriptSourceURL); std::string startupScriptSourceURL);

View File

@ -354,11 +354,11 @@ void JSCExecutor::loadApplicationScript(std::unique_ptr<const JSBigString> scrip
ReactMarker::logTaggedMarker(ReactMarker::RUN_JS_BUNDLE_STOP, scriptName.c_str()); ReactMarker::logTaggedMarker(ReactMarker::RUN_JS_BUNDLE_STOP, scriptName.c_str());
} }
void JSCExecutor::setJSModulesUnbundle(std::unique_ptr<JSModulesUnbundle> unbundle) { void JSCExecutor::setBundleRegistry(std::unique_ptr<RAMBundleRegistry> bundleRegistry) {
if (!m_bundleRegistry) { if (!m_bundleRegistry) {
installNativeHook<&JSCExecutor::nativeRequire>("nativeRequire"); installNativeHook<&JSCExecutor::nativeRequire>("nativeRequire");
} }
m_bundleRegistry = folly::make_unique<RAMBundleRegistry>(std::move(unbundle)); m_bundleRegistry = std::move(bundleRegistry);
} }
void JSCExecutor::bindBridge() throw(JSException) { void JSCExecutor::bindBridge() throw(JSException) {

View File

@ -65,8 +65,7 @@ public:
std::unique_ptr<const JSBigString> script, std::unique_ptr<const JSBigString> script,
std::string sourceURL) override; std::string sourceURL) override;
virtual void setJSModulesUnbundle( virtual void setBundleRegistry(std::unique_ptr<RAMBundleRegistry> bundleRegistry) override;
std::unique_ptr<JSModulesUnbundle> unbundle) override;
virtual void callFunction( virtual void callFunction(
const std::string& moduleId, const std::string& moduleId,

View File

@ -16,6 +16,7 @@ class JSExecutor;
class JSModulesUnbundle; class JSModulesUnbundle;
class MessageQueueThread; class MessageQueueThread;
class ModuleRegistry; class ModuleRegistry;
class RAMBundleRegistry;
// This interface describes the delegate interface required by // This interface describes the delegate interface required by
// Executor implementations to call from JS into native code. // Executor implementations to call from JS into native code.
@ -48,9 +49,9 @@ public:
std::string sourceURL) = 0; std::string sourceURL) = 0;
/** /**
* Add an application "unbundle" file * Add an application "RAM" bundle registry
*/ */
virtual void setJSModulesUnbundle(std::unique_ptr<JSModulesUnbundle> bundle) = 0; virtual void setBundleRegistry(std::unique_ptr<RAMBundleRegistry> bundleRegistry) = 0;
/** /**
* Executes BatchedBridge.callFunctionReturnFlushedQueue with the module ID, * Executes BatchedBridge.callFunctionReturnFlushedQueue with the module ID,

View File

@ -10,8 +10,8 @@
#include "JSBigString.h" #include "JSBigString.h"
#include "SystraceSection.h" #include "SystraceSection.h"
#include "MethodCall.h" #include "MethodCall.h"
#include "JSModulesUnbundle.h"
#include "MessageQueueThread.h" #include "MessageQueueThread.h"
#include "RAMBundleRegistry.h"
#ifdef WITH_FBSYSTRACE #ifdef WITH_FBSYSTRACE
#include <fbsystrace.h> #include <fbsystrace.h>
@ -91,17 +91,17 @@ NativeToJsBridge::~NativeToJsBridge() {
} }
void NativeToJsBridge::loadApplication( void NativeToJsBridge::loadApplication(
std::unique_ptr<JSModulesUnbundle> unbundle, std::unique_ptr<RAMBundleRegistry> bundleRegistry,
std::unique_ptr<const JSBigString> startupScript, std::unique_ptr<const JSBigString> startupScript,
std::string startupScriptSourceURL) { std::string startupScriptSourceURL) {
runOnExecutorQueue( runOnExecutorQueue(
[unbundleWrap=folly::makeMoveWrapper(std::move(unbundle)), [bundleRegistryWrap=folly::makeMoveWrapper(std::move(bundleRegistry)),
startupScript=folly::makeMoveWrapper(std::move(startupScript)), startupScript=folly::makeMoveWrapper(std::move(startupScript)),
startupScriptSourceURL=std::move(startupScriptSourceURL)] startupScriptSourceURL=std::move(startupScriptSourceURL)]
(JSExecutor* executor) mutable { (JSExecutor* executor) mutable {
auto unbundle = unbundleWrap.move(); auto bundleRegistry = bundleRegistryWrap.move();
if (unbundle) { if (bundleRegistry) {
executor->setJSModulesUnbundle(std::move(unbundle)); executor->setBundleRegistry(std::move(bundleRegistry));
} }
executor->loadApplicationScript(std::move(*startupScript), executor->loadApplicationScript(std::move(*startupScript),
std::move(startupScriptSourceURL)); std::move(startupScriptSourceURL));
@ -109,11 +109,11 @@ void NativeToJsBridge::loadApplication(
} }
void NativeToJsBridge::loadApplicationSync( void NativeToJsBridge::loadApplicationSync(
std::unique_ptr<JSModulesUnbundle> unbundle, std::unique_ptr<RAMBundleRegistry> bundleRegistry,
std::unique_ptr<const JSBigString> startupScript, std::unique_ptr<const JSBigString> startupScript,
std::string startupScriptSourceURL) { std::string startupScriptSourceURL) {
if (unbundle) { if (bundleRegistry) {
m_executor->setJSModulesUnbundle(std::move(unbundle)); m_executor->setBundleRegistry(std::move(bundleRegistry));
} }
m_executor->loadApplicationScript(std::move(startupScript), m_executor->loadApplicationScript(std::move(startupScript),
std::move(startupScriptSourceURL)); std::move(startupScriptSourceURL));

View File

@ -18,10 +18,10 @@ namespace facebook {
namespace react { namespace react {
struct InstanceCallback; struct InstanceCallback;
class JSModulesUnbundle;
class JsToNativeBridge; class JsToNativeBridge;
class MessageQueueThread; class MessageQueueThread;
class ModuleRegistry; class ModuleRegistry;
class RAMBundleRegistry;
// This class manages calls from native code to JS. It also manages // This class manages calls from native code to JS. It also manages
// executors and their threads. All functions here can be called from // executors and their threads. All functions here can be called from
@ -85,16 +85,16 @@ public:
} }
/** /**
* Starts the JS application. If unbundle is non-null, then it is * Starts the JS application. If bundleRegistry is non-null, then it is
* used to fetch JavaScript modules as individual scripts. * used to fetch JavaScript modules as individual scripts.
* Otherwise, the script is assumed to include all the modules. * Otherwise, the script is assumed to include all the modules.
*/ */
void loadApplication( void loadApplication(
std::unique_ptr<JSModulesUnbundle> unbundle, std::unique_ptr<RAMBundleRegistry> bundleRegistry,
std::unique_ptr<const JSBigString> startupCode, std::unique_ptr<const JSBigString> startupCode,
std::string sourceURL); std::string sourceURL);
void loadApplicationSync( void loadApplicationSync(
std::unique_ptr<JSModulesUnbundle> unbundle, std::unique_ptr<RAMBundleRegistry> bundleRegistry,
std::unique_ptr<const JSBigString> startupCode, std::unique_ptr<const JSBigString> startupCode,
std::string sourceURL); std::string sourceURL);

View File

@ -12,6 +12,10 @@ RAMBundleRegistry::RAMBundleRegistry(std::unique_ptr<JSModulesUnbundle> mainBund
} }
JSModulesUnbundle::Module RAMBundleRegistry::getModule(uint32_t bundleId, uint32_t moduleId) { JSModulesUnbundle::Module RAMBundleRegistry::getModule(uint32_t bundleId, uint32_t moduleId) {
if (m_bundles.find(bundleId) == m_bundles.end()) {
m_bundles.emplace(bundleId, this->bundleById(bundleId));
}
return getBundle(bundleId)->getModule(moduleId); return getBundle(bundleId)->getModule(moduleId);
} }

View File

@ -8,16 +8,25 @@
#include <utility> #include <utility>
#include <cxxreact/JSModulesUnbundle.h> #include <cxxreact/JSModulesUnbundle.h>
#include <jschelpers/noncopyable.h>
namespace facebook { namespace facebook {
namespace react { namespace react {
class RAMBundleRegistry { class RAMBundleRegistry : noncopyable {
public: public:
constexpr static uint32_t MAIN_BUNDLE_ID = 0; constexpr static uint32_t MAIN_BUNDLE_ID = 0;
explicit RAMBundleRegistry(std::unique_ptr<JSModulesUnbundle> mainBundle); explicit RAMBundleRegistry(std::unique_ptr<JSModulesUnbundle> mainBundle);
RAMBundleRegistry(RAMBundleRegistry&&) = default;
RAMBundleRegistry& operator=(RAMBundleRegistry&&) = default;
JSModulesUnbundle::Module getModule(uint32_t bundleId, uint32_t moduleId); JSModulesUnbundle::Module getModule(uint32_t bundleId, uint32_t moduleId);
virtual ~RAMBundleRegistry() {};
protected:
virtual std::unique_ptr<JSModulesUnbundle> bundleById(uint32_t index) const {
throw std::runtime_error("Please, override this method in a subclass to support multiple RAM bundles.");
}
private: private:
JSModulesUnbundle *getBundle(uint32_t bundleId) const; JSModulesUnbundle *getBundle(uint32_t bundleId) const;