mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Configure JSExector with BundleRegistry instead of JSModulesUnbundle
Differential Revision: D5890458 fbshipit-source-id: 968be95786ffbf53aa98928d4d3e3bd52a84b3dc
This commit is contained in:
committed by
Facebook Github Bot
parent
e9aab0d452
commit
7d115730dc
@@ -8,16 +8,29 @@
|
||||
#include <utility>
|
||||
|
||||
#include <cxxreact/JSModulesUnbundle.h>
|
||||
#include <jschelpers/noncopyable.h>
|
||||
|
||||
#ifndef RN_EXPORT
|
||||
#define RN_EXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
class RAMBundleRegistry {
|
||||
class RN_EXPORT RAMBundleRegistry : noncopyable {
|
||||
public:
|
||||
constexpr static uint32_t MAIN_BUNDLE_ID = 0;
|
||||
|
||||
explicit RAMBundleRegistry(std::unique_ptr<JSModulesUnbundle> mainBundle);
|
||||
RAMBundleRegistry(RAMBundleRegistry&&) = default;
|
||||
RAMBundleRegistry& operator=(RAMBundleRegistry&&) = default;
|
||||
|
||||
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:
|
||||
JSModulesUnbundle *getBundle(uint32_t bundleId) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user