mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-05 09:29:07 +08:00
Experimental App Bundle API
Reviewed By: michalgr Differential Revision: D4198629 fbshipit-source-id: b96a4b3ad3e5ab6b4cb8892442c6077edf7058a3
This commit is contained in:
committed by
Facebook Github Bot
parent
bcac6e7d39
commit
9e00a42fd7
@@ -22,6 +22,14 @@ void JSExecutor::loadApplicationScript(std::string bundlePath, std::string sourc
|
||||
std::move(sourceURL));
|
||||
}
|
||||
|
||||
void JSExecutor::loadApplicationScript(int fd, std::string sourceURL) {
|
||||
struct stat fileInfo;
|
||||
folly::checkUnixError(::fstat(fd, &fileInfo), "fstat on bundle failed.");
|
||||
|
||||
auto bundle = folly::make_unique<JSBigFileString>(fd, fileInfo.st_size);
|
||||
return loadApplicationScript(std::move(bundle), std::move(sourceURL));
|
||||
}
|
||||
|
||||
static JSBigOptimizedBundleString::Encoding encodingFromByte(uint8_t byte) {
|
||||
switch (byte) {
|
||||
case 0:
|
||||
|
||||
Reference in New Issue
Block a user