mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Revert D72384347: Move ReactMarker to reactnativejni_common as it's used in NewArch also
Differential Revision: D72384347 Original commit changeset: 83965c3e4eb7 Original Phabricator Diff: D72384347 fbshipit-source-id: 47cfe95479ce749ebb8e102d147bd5da4fa26e31
This commit is contained in:
committed by
Facebook GitHub Bot
parent
91c6cf2aed
commit
512e680d72
+1
@@ -35,6 +35,7 @@ internal object BridgeSoLoader {
|
||||
|
||||
@get:JvmStatic
|
||||
@get:JvmName("isInitialized")
|
||||
@Volatile
|
||||
var initialized: Boolean = false
|
||||
private set
|
||||
}
|
||||
|
||||
+2
-1
@@ -9,6 +9,7 @@ package com.facebook.react.bridge
|
||||
|
||||
import com.facebook.jni.HybridClassBase
|
||||
import com.facebook.proguard.annotations.DoNotStripAny
|
||||
import com.facebook.soloader.SoLoader
|
||||
|
||||
/**
|
||||
* An implementation of [Dynamic] that has a C++ implementation.
|
||||
@@ -48,7 +49,7 @@ private class DynamicNative : HybridClassBase(), Dynamic {
|
||||
|
||||
private companion object {
|
||||
init {
|
||||
ReactNativeJniCommonSoLoader.staticInit()
|
||||
SoLoader.loadLibrary("reactnativejni_common")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -9,6 +9,7 @@ package com.facebook.react.bridge
|
||||
|
||||
import com.facebook.jni.HybridClassBase
|
||||
import com.facebook.proguard.annotations.DoNotStrip
|
||||
import com.facebook.soloader.SoLoader
|
||||
|
||||
/** Base class for an array whose members are stored in native code (C++). */
|
||||
@DoNotStrip
|
||||
@@ -19,7 +20,7 @@ public abstract class NativeArray protected constructor() :
|
||||
|
||||
private companion object {
|
||||
init {
|
||||
ReactNativeJniCommonSoLoader.staticInit()
|
||||
SoLoader.loadLibrary("reactnativejni_common")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -9,6 +9,7 @@ package com.facebook.react.bridge
|
||||
|
||||
import com.facebook.jni.HybridClassBase
|
||||
import com.facebook.proguard.annotations.DoNotStrip
|
||||
import com.facebook.soloader.SoLoader
|
||||
|
||||
/** Base class for a Map whose keys and values are stored in native code (C++). */
|
||||
@DoNotStrip
|
||||
@@ -17,7 +18,7 @@ public abstract class NativeMap : HybridClassBase() {
|
||||
|
||||
private companion object {
|
||||
init {
|
||||
ReactNativeJniCommonSoLoader.staticInit()
|
||||
SoLoader.loadLibrary("reactnativejni_common")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -211,7 +211,7 @@ public class ReactMarker {
|
||||
now = SystemClock.uptimeMillis();
|
||||
}
|
||||
|
||||
if (ReactNativeJniCommonSoLoader.isInitialized()) {
|
||||
if (BridgeSoLoader.isInitialized()) {
|
||||
// First send the current marker
|
||||
nativeLogMarker(name.name(), now);
|
||||
|
||||
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.bridge
|
||||
|
||||
import com.facebook.soloader.SoLoader
|
||||
|
||||
internal object ReactNativeJniCommonSoLoader {
|
||||
|
||||
@JvmStatic
|
||||
@Synchronized
|
||||
fun staticInit() {
|
||||
if (initialized) {
|
||||
return
|
||||
}
|
||||
ReactMarker.logMarker(ReactMarkerConstants.LOAD_REACT_NATIVE_SO_FILE_START)
|
||||
SoLoader.loadLibrary("reactnativejni_common")
|
||||
ReactMarker.logMarker(ReactMarkerConstants.LOAD_REACT_NATIVE_SO_FILE_END)
|
||||
initialized = true
|
||||
}
|
||||
|
||||
@get:JvmStatic
|
||||
@get:JvmName("isInitialized")
|
||||
@Volatile
|
||||
var initialized: Boolean = false
|
||||
private set
|
||||
}
|
||||
+1
-1
@@ -62,7 +62,7 @@ public object LegacyArchitectureLogger {
|
||||
}
|
||||
LegacyArchitectureLogLevel.WARNING -> {
|
||||
ReactSoftExceptionLogger.logSoftException(
|
||||
tag, ReactNoCrashSoftException("$name $exceptionMessage"))
|
||||
tag, ReactNoCrashSoftException("$name $exceptionMessage."))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,11 +24,10 @@ add_library(
|
||||
reactnativejni_common
|
||||
OBJECT
|
||||
JDynamicNative.cpp
|
||||
JReactMarker.cpp
|
||||
NativeArray.cpp
|
||||
NativeCommon.cpp
|
||||
NativeMap.cpp
|
||||
OnLoad-common.cpp
|
||||
OnLoad-common.cpp
|
||||
ReadableNativeArray.cpp
|
||||
ReadableNativeMap.cpp
|
||||
WritableNativeArray.cpp
|
||||
@@ -37,7 +36,7 @@ add_library(
|
||||
target_merge_so(reactnativejni_common)
|
||||
target_include_directories(reactnativejni_common PUBLIC ../../)
|
||||
|
||||
target_link_libraries(reactnativejni_common fbjni folly_runtime react_cxxreact)
|
||||
target_link_libraries(reactnativejni_common fbjni folly_runtime)
|
||||
target_compile_reactnative_options(reactnativejni_common PRIVATE)
|
||||
target_compile_options(reactnativejni_common PRIVATE -Wno-unused-lambda-capture)
|
||||
|
||||
@@ -56,6 +55,7 @@ add_library(
|
||||
JInspector.cpp
|
||||
JMessageQueueThread.cpp
|
||||
JReactCxxErrorHandler.cpp
|
||||
JReactMarker.cpp
|
||||
JReactSoftExceptionLogger.cpp
|
||||
JRuntimeExecutor.cpp
|
||||
JRuntimeScheduler.cpp
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <fbjni/fbjni.h>
|
||||
#include "JCallback.h"
|
||||
#include "JDynamicNative.h"
|
||||
#include "JReactMarker.h"
|
||||
#include "NativeArray.h"
|
||||
#include "NativeMap.h"
|
||||
#include "WritableNativeArray.h"
|
||||
@@ -20,7 +19,6 @@ extern "C" JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
||||
return facebook::jni::initialize(vm, [] {
|
||||
JCxxCallbackImpl::registerNatives();
|
||||
JDynamicNative::registerNatives();
|
||||
JReactMarker::registerNatives();
|
||||
NativeArray::registerNatives();
|
||||
NativeMap::registerNatives();
|
||||
ReadableNativeArray::registerNatives();
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "CxxModuleWrapperBase.h"
|
||||
#include "InspectorNetworkRequestListener.h"
|
||||
#include "JInspector.h"
|
||||
#include "JReactMarker.h"
|
||||
#include "JavaScriptExecutorHolder.h"
|
||||
#include "ReactInstanceManagerInspectorTarget.h"
|
||||
|
||||
@@ -41,6 +42,7 @@ extern "C" JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
||||
#endif
|
||||
CatalystInstanceImpl::registerNatives();
|
||||
CxxModuleWrapperBase::registerNatives();
|
||||
JReactMarker::registerNatives();
|
||||
JInspector::registerNatives();
|
||||
ReactInstanceManagerInspectorTarget::registerNatives();
|
||||
InspectorNetworkRequestListener::registerNatives();
|
||||
|
||||
Reference in New Issue
Block a user