mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-06 09:31:11 +08:00
Add systrace to UIManagerModule.createConstants
Summary: - Differentiate when the constants are coming from lazy view managers or not - Add systrace sections to each reactpackage iteration for lazy view managers Differential Revision: D9664719 fbshipit-source-id: 3b8c6b3b40667a833471fcb957367501781b0f5d
This commit is contained in:
committed by
Facebook Github Bot
parent
1edeaef6ca
commit
cb6196073a
@@ -792,6 +792,7 @@ public class ReactInstanceManager {
|
||||
}
|
||||
|
||||
public @Nullable List<String> getViewManagerNames() {
|
||||
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ReactInstanceManager.getViewManagerNames");
|
||||
ReactApplicationContext context;
|
||||
synchronized(mReactContextLock) {
|
||||
context = (ReactApplicationContext) getCurrentReactContext();
|
||||
@@ -803,15 +804,20 @@ public class ReactInstanceManager {
|
||||
synchronized (mPackages) {
|
||||
Set<String> uniqueNames = new HashSet<>();
|
||||
for (ReactPackage reactPackage : mPackages) {
|
||||
SystraceMessage.beginSection(
|
||||
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ReactInstanceManager.getViewManagerName")
|
||||
.arg("Package", reactPackage.getClass().getSimpleName())
|
||||
.flush();
|
||||
if (reactPackage instanceof ViewManagerOnDemandReactPackage) {
|
||||
List<String> names =
|
||||
((ViewManagerOnDemandReactPackage) reactPackage)
|
||||
.getViewManagerNames(context);
|
||||
((ViewManagerOnDemandReactPackage) reactPackage).getViewManagerNames(context);
|
||||
if (names != null) {
|
||||
uniqueNames.addAll(names);
|
||||
}
|
||||
}
|
||||
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||
}
|
||||
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||
return new ArrayList<>(uniqueNames);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user