mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove MC for runtime scheduler
Summary: Remove redundant feature flag. Changelog: [internal] Reviewed By: javache Differential Revision: D39382607 fbshipit-source-id: fb0292258e6722160a6a1104aa1c8e35a4281a15
This commit is contained in:
committed by
Facebook GitHub Bot
parent
56c28f3740
commit
9929eadcb4
@@ -108,7 +108,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
// C++ parts
|
||||
private final HybridData mHybridData;
|
||||
|
||||
private static native HybridData initHybrid(boolean enableRuntimeScheduler);
|
||||
private static native HybridData initHybrid();
|
||||
|
||||
public native CallInvokerHolderImpl getJSCallInvokerHolder();
|
||||
|
||||
@@ -123,7 +123,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
FLog.d(ReactConstants.TAG, "Initializing React Xplat Bridge.");
|
||||
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "createCatalystInstanceImpl");
|
||||
|
||||
mHybridData = initHybrid(ReactFeatureFlags.enableRuntimeScheduler);
|
||||
mHybridData = initHybrid();
|
||||
|
||||
mReactQueueConfiguration =
|
||||
ReactQueueConfigurationImpl.create(
|
||||
|
||||
@@ -70,8 +70,6 @@ public class ReactFeatureFlags {
|
||||
/** This feature flag enables logs for Fabric */
|
||||
public static boolean enableFabricLogs = false;
|
||||
|
||||
public static boolean enableRuntimeScheduler = false;
|
||||
|
||||
/** Feature flag to configure eager attachment of the root view/initialisation of the JS code */
|
||||
public static boolean enableEagerRootViewAttachment = false;
|
||||
|
||||
|
||||
@@ -93,15 +93,12 @@ class JInstanceCallback : public InstanceCallback {
|
||||
} // namespace
|
||||
|
||||
jni::local_ref<CatalystInstanceImpl::jhybriddata>
|
||||
CatalystInstanceImpl::initHybrid(
|
||||
jni::alias_ref<jclass>,
|
||||
bool enableRuntimeScheduler) {
|
||||
return makeCxxInstance(enableRuntimeScheduler);
|
||||
CatalystInstanceImpl::initHybrid(jni::alias_ref<jclass>) {
|
||||
return makeCxxInstance();
|
||||
}
|
||||
|
||||
CatalystInstanceImpl::CatalystInstanceImpl(bool enableRuntimeScheduler)
|
||||
: instance_(std::make_unique<Instance>()),
|
||||
enableRuntimeScheduler_(enableRuntimeScheduler) {}
|
||||
CatalystInstanceImpl::CatalystInstanceImpl()
|
||||
: instance_(std::make_unique<Instance>()) {}
|
||||
|
||||
void CatalystInstanceImpl::warnOnLegacyNativeModuleSystemUse() {
|
||||
CxxNativeModule::setShouldWarnOnUse(true);
|
||||
@@ -376,17 +373,12 @@ void CatalystInstanceImpl::handleMemoryPressure(int pressureLevel) {
|
||||
jni::alias_ref<CallInvokerHolder::javaobject>
|
||||
CatalystInstanceImpl::getJSCallInvokerHolder() {
|
||||
if (!jsCallInvokerHolder_) {
|
||||
if (enableRuntimeScheduler_) {
|
||||
auto runtimeScheduler = getRuntimeScheduler();
|
||||
auto runtimeSchedulerCallInvoker =
|
||||
std::make_shared<RuntimeSchedulerCallInvoker>(
|
||||
runtimeScheduler->cthis()->get());
|
||||
jsCallInvokerHolder_ = jni::make_global(
|
||||
CallInvokerHolder::newObjectCxxArgs(runtimeSchedulerCallInvoker));
|
||||
} else {
|
||||
jsCallInvokerHolder_ = jni::make_global(
|
||||
CallInvokerHolder::newObjectCxxArgs(instance_->getJSCallInvoker()));
|
||||
}
|
||||
auto runtimeScheduler = getRuntimeScheduler();
|
||||
auto runtimeSchedulerCallInvoker =
|
||||
std::make_shared<RuntimeSchedulerCallInvoker>(
|
||||
runtimeScheduler->cthis()->get());
|
||||
jsCallInvokerHolder_ = jni::make_global(
|
||||
CallInvokerHolder::newObjectCxxArgs(runtimeSchedulerCallInvoker));
|
||||
}
|
||||
return jsCallInvokerHolder_;
|
||||
}
|
||||
@@ -434,7 +426,7 @@ CatalystInstanceImpl::getRuntimeExecutor() {
|
||||
|
||||
jni::alias_ref<JRuntimeScheduler::javaobject>
|
||||
CatalystInstanceImpl::getRuntimeScheduler() {
|
||||
if (enableRuntimeScheduler_ && !runtimeScheduler_) {
|
||||
if (!runtimeScheduler_) {
|
||||
auto runtimeExecutor = instance_->getRuntimeExecutor();
|
||||
auto runtimeScheduler = std::make_shared<RuntimeScheduler>(runtimeExecutor);
|
||||
|
||||
|
||||
@@ -37,9 +37,7 @@ class CatalystInstanceImpl : public jni::HybridClass<CatalystInstanceImpl> {
|
||||
static constexpr auto kJavaDescriptor =
|
||||
"Lcom/facebook/react/bridge/CatalystInstanceImpl;";
|
||||
|
||||
static jni::local_ref<jhybriddata> initHybrid(
|
||||
jni::alias_ref<jclass>,
|
||||
bool enableRuntimeScheduler);
|
||||
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>);
|
||||
|
||||
static void registerNatives();
|
||||
|
||||
@@ -50,7 +48,7 @@ class CatalystInstanceImpl : public jni::HybridClass<CatalystInstanceImpl> {
|
||||
private:
|
||||
friend HybridBase;
|
||||
|
||||
CatalystInstanceImpl(bool enableRuntimeScheduler);
|
||||
CatalystInstanceImpl();
|
||||
|
||||
void initializeBridge(
|
||||
jni::alias_ref<ReactCallback::javaobject> callback,
|
||||
@@ -117,8 +115,6 @@ class CatalystInstanceImpl : public jni::HybridClass<CatalystInstanceImpl> {
|
||||
jni::global_ref<CallInvokerHolder::javaobject> nativeCallInvokerHolder_;
|
||||
jni::global_ref<JRuntimeExecutor::javaobject> runtimeExecutor_;
|
||||
jni::global_ref<JRuntimeScheduler::javaobject> runtimeScheduler_;
|
||||
|
||||
bool const enableRuntimeScheduler_;
|
||||
};
|
||||
|
||||
} // namespace react
|
||||
|
||||
Reference in New Issue
Block a user