mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-12 03:35:30 +08:00
log script name with bundle loading perf event
Reviewed By: javache Differential Revision: D5010638 fbshipit-source-id: 2e139201a8374245fa1dedc4f11a716dcf700fd7
This commit is contained in:
committed by
Facebook Github Bot
parent
5dcfb2c6ad
commit
65f22a5190
@@ -292,11 +292,18 @@ static const char* explainLoadSourceStatus(JSLoadSourceStatus status) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// basename_r isn't in all iOS SDKs, so use this simple version instead.
|
||||
static std::string simpleBasename(const std::string &path) {
|
||||
size_t pos = path.rfind("/");
|
||||
return (pos != std::string::npos) ? path.substr(pos) : path;
|
||||
}
|
||||
|
||||
void JSCExecutor::loadApplicationScript(std::unique_ptr<const JSBigString> script, std::string sourceURL) {
|
||||
SystraceSection s("JSCExecutor::loadApplicationScript",
|
||||
"sourceURL", sourceURL);
|
||||
|
||||
ReactMarker::logMarker(ReactMarker::RUN_JS_BUNDLE_START);
|
||||
std::string scriptName = simpleBasename(sourceURL);
|
||||
ReactMarker::logTaggedMarker(ReactMarker::RUN_JS_BUNDLE_START, scriptName.c_str());
|
||||
String jsSourceURL(m_context, sourceURL.c_str());
|
||||
|
||||
// TODO t15069155: reduce the number of overrides here
|
||||
|
||||
Reference in New Issue
Block a user