mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-09 04:08:11 +08:00
Differential Revision: D5850963 fbshipit-source-id: e1bd6d74953872d38e73a20f6d054905a7e4c80c
24 lines
647 B
C++
24 lines
647 B
C++
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
#include "RAMBundleRegistry.h"
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
constexpr uint32_t RAMBundleRegistry::MAIN_BUNDLE_ID;
|
|
|
|
RAMBundleRegistry::RAMBundleRegistry(std::unique_ptr<JSModulesUnbundle> mainBundle) {
|
|
m_bundles.emplace(MAIN_BUNDLE_ID, std::move(mainBundle));
|
|
}
|
|
|
|
JSModulesUnbundle::Module RAMBundleRegistry::getModule(uint32_t bundleId, uint32_t moduleId) {
|
|
return getBundle(bundleId)->getModule(moduleId);
|
|
}
|
|
|
|
JSModulesUnbundle *RAMBundleRegistry::getBundle(uint32_t bundleId) const {
|
|
return m_bundles.at(bundleId).get();
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|