mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-14 16:39:47 +08:00
add marker surrounding entire native module creation
Reviewed By: javache Differential Revision: D5200856 fbshipit-source-id: 35b0e627224d518126a1cfdd36d6af264dd186cf
This commit is contained in:
committed by
Facebook Github Bot
parent
80bc07fd60
commit
2984628357
@@ -4,6 +4,8 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
@@ -41,6 +43,8 @@ void JSCNativeModules::reset() {
|
||||
}
|
||||
|
||||
folly::Optional<Object> JSCNativeModules::createModule(const std::string& name, JSContextRef context) {
|
||||
ReactMarker::logTaggedMarker(ReactMarker::NATIVE_MODULE_SETUP_START, name.c_str());
|
||||
|
||||
if (!m_genNativeModuleJS) {
|
||||
auto global = Object::getGlobalObject(context);
|
||||
m_genNativeModuleJS = global.getProperty("__fbGenNativeModule").asObject();
|
||||
@@ -58,7 +62,11 @@ folly::Optional<Object> JSCNativeModules::createModule(const std::string& name,
|
||||
});
|
||||
CHECK(!moduleInfo.isNull()) << "Module returned from genNativeModule is null";
|
||||
|
||||
return moduleInfo.asObject().getProperty("module").asObject();
|
||||
folly::Optional<Object> module(moduleInfo.asObject().getProperty("module").asObject());
|
||||
|
||||
ReactMarker::logTaggedMarker(ReactMarker::NATIVE_MODULE_SETUP_STOP, name.c_str());
|
||||
|
||||
return module;
|
||||
}
|
||||
|
||||
} }
|
||||
|
||||
Reference in New Issue
Block a user