mirror of
https://github.com/status-im/react-native.git
synced 2025-01-13 11:05:21 +00:00
add marker surrounding entire native module creation
Reviewed By: javache Differential Revision: D5200856 fbshipit-source-id: 35b0e627224d518126a1cfdd36d6af264dd186cf
This commit is contained in:
parent
80bc07fd60
commit
2984628357
@ -97,6 +97,8 @@ static void registerPerformanceLoggerHooks(RCTPerformanceLogger *performanceLogg
|
|||||||
case ReactMarker::CREATE_REACT_CONTEXT_STOP:
|
case ReactMarker::CREATE_REACT_CONTEXT_STOP:
|
||||||
case ReactMarker::JS_BUNDLE_STRING_CONVERT_START:
|
case ReactMarker::JS_BUNDLE_STRING_CONVERT_START:
|
||||||
case ReactMarker::JS_BUNDLE_STRING_CONVERT_STOP:
|
case ReactMarker::JS_BUNDLE_STRING_CONVERT_STOP:
|
||||||
|
case ReactMarker::NATIVE_MODULE_SETUP_START:
|
||||||
|
case ReactMarker::NATIVE_MODULE_SETUP_STOP:
|
||||||
// These are not used on iOS.
|
// These are not used on iOS.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,8 @@ public enum ReactMarkerConstants {
|
|||||||
CREATE_VIEW_MANAGERS_END,
|
CREATE_VIEW_MANAGERS_END,
|
||||||
CREATE_UI_MANAGER_MODULE_CONSTANTS_START,
|
CREATE_UI_MANAGER_MODULE_CONSTANTS_START,
|
||||||
CREATE_UI_MANAGER_MODULE_CONSTANTS_END,
|
CREATE_UI_MANAGER_MODULE_CONSTANTS_END,
|
||||||
|
NATIVE_MODULE_SETUP_START,
|
||||||
|
NATIVE_MODULE_SETUP_END,
|
||||||
CREATE_MODULE_START,
|
CREATE_MODULE_START,
|
||||||
CREATE_MODULE_END,
|
CREATE_MODULE_END,
|
||||||
PROCESS_CORE_REACT_PACKAGE_START,
|
PROCESS_CORE_REACT_PACKAGE_START,
|
||||||
|
@ -139,6 +139,12 @@ static void logPerfMarker(const ReactMarker::ReactMarkerId markerId, const char*
|
|||||||
case ReactMarker::JS_BUNDLE_STRING_CONVERT_STOP:
|
case ReactMarker::JS_BUNDLE_STRING_CONVERT_STOP:
|
||||||
JReactMarker::logMarker("loadApplicationScript_endStringConvert");
|
JReactMarker::logMarker("loadApplicationScript_endStringConvert");
|
||||||
break;
|
break;
|
||||||
|
case ReactMarker::NATIVE_MODULE_SETUP_START:
|
||||||
|
JReactMarker::logMarker("NATIVE_MODULE_SETUP_START", tag);
|
||||||
|
break;
|
||||||
|
case ReactMarker::NATIVE_MODULE_SETUP_STOP:
|
||||||
|
JReactMarker::logMarker("NATIVE_MODULE_SETUP_END", tag);
|
||||||
|
break;
|
||||||
case ReactMarker::NATIVE_REQUIRE_START:
|
case ReactMarker::NATIVE_REQUIRE_START:
|
||||||
case ReactMarker::NATIVE_REQUIRE_STOP:
|
case ReactMarker::NATIVE_REQUIRE_STOP:
|
||||||
// These are not used on Android.
|
// These are not used on Android.
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "Platform.h"
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace react {
|
namespace react {
|
||||||
|
|
||||||
@ -41,6 +43,8 @@ void JSCNativeModules::reset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
folly::Optional<Object> JSCNativeModules::createModule(const std::string& name, JSContextRef context) {
|
folly::Optional<Object> JSCNativeModules::createModule(const std::string& name, JSContextRef context) {
|
||||||
|
ReactMarker::logTaggedMarker(ReactMarker::NATIVE_MODULE_SETUP_START, name.c_str());
|
||||||
|
|
||||||
if (!m_genNativeModuleJS) {
|
if (!m_genNativeModuleJS) {
|
||||||
auto global = Object::getGlobalObject(context);
|
auto global = Object::getGlobalObject(context);
|
||||||
m_genNativeModuleJS = global.getProperty("__fbGenNativeModule").asObject();
|
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";
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
@ -23,6 +23,8 @@ enum ReactMarkerId {
|
|||||||
CREATE_REACT_CONTEXT_STOP,
|
CREATE_REACT_CONTEXT_STOP,
|
||||||
JS_BUNDLE_STRING_CONVERT_START,
|
JS_BUNDLE_STRING_CONVERT_START,
|
||||||
JS_BUNDLE_STRING_CONVERT_STOP,
|
JS_BUNDLE_STRING_CONVERT_STOP,
|
||||||
|
NATIVE_MODULE_SETUP_START,
|
||||||
|
NATIVE_MODULE_SETUP_STOP,
|
||||||
};
|
};
|
||||||
|
|
||||||
using LogTaggedMarker = std::function<void(const ReactMarkerId, const char* tag)>;
|
using LogTaggedMarker = std::function<void(const ReactMarkerId, const char* tag)>;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user