mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java (#56205)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56205 Reviewed By: cortinico Differential Revision: D97734523 fbshipit-source-id: b99454c945805ab8f1c15aa20e4336c7a7e7c011
This commit is contained in:
1 parent
32f1dcd804
commit
6860ec7155
1 file changed
-46
-46
@@ -10,15 +10,11 @@ package com.facebook.react;
|
||||
import static com.facebook.infer.annotation.ThreadConfined.UI;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.ATTACH_MEASURED_ROOT_VIEWS_END;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.ATTACH_MEASURED_ROOT_VIEWS_START;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.BUILD_NATIVE_MODULE_REGISTRY_END;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.BUILD_NATIVE_MODULE_REGISTRY_START;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.CHANGE_THREAD_PRIORITY;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.CREATE_VIEW_MANAGERS_END;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.CREATE_VIEW_MANAGERS_START;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.PRE_SETUP_REACT_CONTEXT_END;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.PRE_SETUP_REACT_CONTEXT_START;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.PROCESS_PACKAGES_END;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.PROCESS_PACKAGES_START;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.REACT_CONTEXT_THREAD_END;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.REACT_CONTEXT_THREAD_START;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT_END;
|
||||
@@ -52,7 +48,6 @@ import com.facebook.react.bridge.JSBundleLoader;
|
||||
import com.facebook.react.bridge.JSExceptionHandler;
|
||||
import com.facebook.react.bridge.JavaScriptExecutor;
|
||||
import com.facebook.react.bridge.JavaScriptExecutorFactory;
|
||||
import com.facebook.react.bridge.NativeModuleRegistry;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.bridge.ReactMarker;
|
||||
@@ -1395,45 +1390,4 @@ public class ReactInstanceManager {
|
||||
"ReactInstanceManager.createReactContext is unsupported. CatalystInstanceImpl has been"
|
||||
+ " removed.");
|
||||
}
|
||||
|
||||
private NativeModuleRegistry processPackages(
|
||||
ReactApplicationContext reactContext, List<ReactPackage> packages) {
|
||||
NativeModuleRegistryBuilder nativeModuleRegistryBuilder =
|
||||
new NativeModuleRegistryBuilder(reactContext);
|
||||
|
||||
ReactMarker.logMarker(PROCESS_PACKAGES_START);
|
||||
|
||||
synchronized (mPackages) {
|
||||
for (ReactPackage reactPackage : packages) {
|
||||
Systrace.beginSection(TRACE_TAG_REACT, "createAndProcessCustomReactPackage");
|
||||
try {
|
||||
processPackage(reactPackage, nativeModuleRegistryBuilder);
|
||||
} finally {
|
||||
Systrace.endSection(TRACE_TAG_REACT);
|
||||
}
|
||||
}
|
||||
}
|
||||
ReactMarker.logMarker(PROCESS_PACKAGES_END);
|
||||
|
||||
ReactMarker.logMarker(BUILD_NATIVE_MODULE_REGISTRY_START);
|
||||
Systrace.beginSection(TRACE_TAG_REACT, "buildNativeModuleRegistry");
|
||||
NativeModuleRegistry nativeModuleRegistry;
|
||||
try {
|
||||
nativeModuleRegistry = nativeModuleRegistryBuilder.build();
|
||||
} finally {
|
||||
Systrace.endSection(TRACE_TAG_REACT);
|
||||
ReactMarker.logMarker(BUILD_NATIVE_MODULE_REGISTRY_END);
|
||||
}
|
||||
|
||||
return nativeModuleRegistry;
|
||||
}
|
||||
|
||||
private void processPackage(
|
||||
ReactPackage reactPackage, NativeModuleRegistryBuilder nativeModuleRegistryBuilder) {
|
||||
SystraceMessage.beginSection(TRACE_TAG_REACT, "processPackage")
|
||||
.arg("className", reactPackage.getClass().getSimpleName())
|
||||
.flush();
|
||||
nativeModuleRegistryBuilder.processPackage(reactPackage);
|
||||
SystraceMessage.endSection(TRACE_TAG_REACT).flush();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user