Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
import com.facebook.react.bridge.NativeModuleRegistry;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactCxxErrorHandler;
import com.facebook.react.bridge.ReactMarker;
import com.facebook.react.bridge.ReactMarkerConstants;
import com.facebook.react.bridge.ReactNoCrashSoftException;
Expand All @@ -75,7 +74,6 @@
import com.facebook.react.common.annotations.internal.LegacyArchitecture;
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel;
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.react.devsupport.DevSupportManagerFactory;
import com.facebook.react.devsupport.ReactInstanceDevHelper;
import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;
Expand Down Expand Up @@ -107,7 +105,6 @@
import com.facebook.soloader.SoLoader;
import com.facebook.systrace.Systrace;
import com.facebook.systrace.SystraceMessage;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -304,8 +301,6 @@ public static ReactInstanceManagerBuilder builder() {
mDevSupportManager.startInspector();
}

registerCxxErrorHandlerFunc();

// Using `if (true)` just to prevent tests / lint errors.
if (true) {
// Legacy architecture of React Native is deprecated and can't be initialized anymore.
Expand Down Expand Up @@ -402,24 +397,6 @@ public void handleCxxError(Exception e) {
mDevSupportManager.handleException(e);
}

private void registerCxxErrorHandlerFunc() {
if (!ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE) {
Class[] parameterTypes = new Class[1];
parameterTypes[0] = Exception.class;
Method handleCxxErrorFunc = null;
try {
handleCxxErrorFunc = ReactInstanceManager.class.getMethod("handleCxxError", parameterTypes);
} catch (NoSuchMethodException e) {
FLog.e("ReactInstanceHolder", "Failed to set cxx error handler function", e);
}
ReactCxxErrorHandler.setHandleErrorFunc(this, handleCxxErrorFunc);
}
}

private void unregisterCxxErrorHandlerFunc() {
ReactCxxErrorHandler.setHandleErrorFunc(null, null);
}

static void initializeSoLoaderIfNecessary(Context applicationContext) {
// Call SoLoader.initialize here, this is required for apps that does not use exopackage and
// does not use SoLoader for loading other native code except from the one used by React Native
Expand Down Expand Up @@ -799,7 +776,6 @@ public void destroy() {

moveToBeforeCreateLifecycleState();
mMemoryPressureRouter.destroy(mApplicationContext);
unregisterCxxErrorHandlerFunc();

mCreateReactContextThread = null;
synchronized (mAttachedReactRoots) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ add_library(
InspectorNetworkRequestListener.cpp
JExecutor.cpp
JMessageQueueThread.cpp
JReactCxxErrorHandler.cpp
JReactSoftExceptionLogger.cpp
JRuntimeExecutor.cpp
JRuntimeScheduler.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#include <logger/react_native_log.h>

#include "JReactCxxErrorHandler.h"
#include "JReactSoftExceptionLogger.h"
#include "JavaScriptExecutorHolder.h"
#include "JniJSModulesUnbundle.h"
Expand Down Expand Up @@ -147,7 +146,6 @@ void log(ReactNativeLogLevel level, const char* message) {
break;
case ReactNativeLogLevelError:
LOG(ERROR) << message;
JReactCxxErrorHandler::handleError(message);
break;
case ReactNativeLogLevelFatal:
LOG(FATAL) << message;
Expand Down

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/cxx-api/ReactNativeCPP.api
Original file line number Diff line number Diff line change
Expand Up @@ -7182,16 +7182,6 @@ class JMessageQueueThread : public MessageQueueThread {
};
} // namespace facebook::react

/// @src {packages/react-native/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.h}:
namespace facebook::react {
class JReactCxxErrorHandler : public jni::JavaClass<JReactCxxErrorHandler> {
public:
static constexpr const char* kJavaDescriptor =
"Lcom/facebook/react/bridge/ReactCxxErrorHandler;";
static void handleError(std::string message);
};
} // namespace facebook::react

/// @src {packages/react-native/ReactAndroid/src/main/jni/react/jni/JReactMarker.h}:
namespace facebook::react {
class JReactMarker : public facebook::jni::JavaClass<JReactMarker> {
Expand Down