File tree 6 files changed +11
-41
lines changed
6 files changed +11
-41
lines changed Original file line number Diff line number Diff line change @@ -549,12 +549,7 @@ public JavaScriptContextHolder getJavaScriptContextHolder() {
549
549
return mJavaScriptContextHolder ;
550
550
}
551
551
552
- @ Override
553
- public RuntimeExecutor getRuntimeExecutor () {
554
- return getRuntimeExecutor (ReactFeatureFlags .enableRuntimeExecutorFlushing ());
555
- }
556
-
557
- public native RuntimeExecutor getRuntimeExecutor (boolean shouldFlush );
552
+ public native RuntimeExecutor getRuntimeExecutor ();
558
553
559
554
@ Override
560
555
public void addJSIModules (List <JSIModuleSpec > jsiModules ) {
Original file line number Diff line number Diff line change 18
18
*/
19
19
@ DoNotStripAny
20
20
public class ReactFeatureFlags {
21
-
22
- /** An interface used to compute flags on demand. */
23
- public interface FlagProvider {
24
- boolean get ();
25
- }
26
-
27
21
/**
28
22
* Should this application use TurboModules? If yes, then any module that inherits {@link
29
23
* com.facebook.react.turbomodule.core.interfaces.TurboModule} will NOT be passed in to C++
@@ -59,13 +53,6 @@ public interface FlagProvider {
59
53
/** Feature flag to configure eager initialization of MapBuffer So file */
60
54
public static boolean enableEagerInitializeMapBufferSoFile = false ;
61
55
62
- /** Should the RuntimeExecutor call JSIExecutor::flush()? */
63
- private static FlagProvider enableRuntimeExecutorFlushingProvider = null ;
64
-
65
- public static void setEnableRuntimeExecutorFlushingFlagProvider (FlagProvider provider ) {
66
- enableRuntimeExecutorFlushingProvider = provider ;
67
- }
68
-
69
56
private static boolean mapBufferSerializationEnabled = false ;
70
57
71
58
/** Enables or disables MapBuffer Serialization */
@@ -77,14 +64,6 @@ public static boolean isMapBufferSerializationEnabled() {
77
64
return mapBufferSerializationEnabled ;
78
65
}
79
66
80
- public static boolean enableRuntimeExecutorFlushing () {
81
- if (enableRuntimeExecutorFlushingProvider != null ) {
82
- return enableRuntimeExecutorFlushingProvider .get ();
83
- }
84
-
85
- return false ;
86
- }
87
-
88
67
/** Enables Fabric for LogBox */
89
68
public static boolean enableFabricInLogBox = false ;
90
69
Original file line number Diff line number Diff line change @@ -346,10 +346,10 @@ CatalystInstanceImpl::getNativeCallInvokerHolder() {
346
346
}
347
347
348
348
jni::alias_ref<JRuntimeExecutor::javaobject>
349
- CatalystInstanceImpl::getRuntimeExecutor (bool shouldFlush ) {
349
+ CatalystInstanceImpl::getRuntimeExecutor () {
350
350
if (!runtimeExecutor_) {
351
- runtimeExecutor_ = jni::make_global (JRuntimeExecutor::newObjectCxxArgs (
352
- instance_->getRuntimeExecutor (shouldFlush )));
351
+ runtimeExecutor_ = jni::make_global (
352
+ JRuntimeExecutor::newObjectCxxArgs ( instance_->getRuntimeExecutor ()));
353
353
}
354
354
return runtimeExecutor_;
355
355
}
Original file line number Diff line number Diff line change @@ -93,8 +93,7 @@ class CatalystInstanceImpl : public jni::HybridClass<CatalystInstanceImpl> {
93
93
void jniCallJSCallback (jint callbackId, NativeArray *arguments);
94
94
jni::alias_ref<CallInvokerHolder::javaobject> getJSCallInvokerHolder ();
95
95
jni::alias_ref<CallInvokerHolder::javaobject> getNativeCallInvokerHolder ();
96
- jni::alias_ref<JRuntimeExecutor::javaobject> getRuntimeExecutor (
97
- bool shouldFlush);
96
+ jni::alias_ref<JRuntimeExecutor::javaobject> getRuntimeExecutor ();
98
97
void setGlobalVariable (std::string propName, std::string &&jsonValue);
99
98
jlong getJavaScriptContext ();
100
99
void handleMemoryPressure (int pressureLevel);
Original file line number Diff line number Diff line change @@ -246,23 +246,20 @@ std::shared_ptr<CallInvoker> Instance::getJSCallInvoker() {
246
246
return std::static_pointer_cast<CallInvoker>(jsCallInvoker_);
247
247
}
248
248
249
- RuntimeExecutor Instance::getRuntimeExecutor (bool shouldFlush ) {
249
+ RuntimeExecutor Instance::getRuntimeExecutor () {
250
250
std::weak_ptr<NativeToJsBridge> weakNativeToJsBridge = nativeToJsBridge_;
251
251
252
252
auto runtimeExecutor =
253
- [weakNativeToJsBridge,
254
- shouldFlush]( std::function<void (jsi::Runtime & runtime)> &&callback) {
253
+ [weakNativeToJsBridge](
254
+ std::function<void (jsi::Runtime & runtime)> &&callback) {
255
255
if (auto strongNativeToJsBridge = weakNativeToJsBridge.lock ()) {
256
256
strongNativeToJsBridge->runOnExecutorQueue (
257
- [callback = std::move (callback),
258
- shouldFlush](JSExecutor *executor) {
257
+ [callback = std::move (callback)](JSExecutor *executor) {
259
258
jsi::Runtime *runtime =
260
259
(jsi::Runtime *)executor->getJavaScriptContext ();
261
260
try {
262
261
callback (*runtime);
263
- if (shouldFlush) {
264
- executor->flush ();
265
- }
262
+ executor->flush ();
266
263
} catch (jsi::JSError &originalError) {
267
264
handleJSError (*runtime, originalError, true );
268
265
}
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ class RN_EXPORT Instance {
134
134
/* *
135
135
* RuntimeExecutor is used by Fabric to access the jsi::Runtime.
136
136
*/
137
- RuntimeExecutor getRuntimeExecutor (bool shouldFlush );
137
+ RuntimeExecutor getRuntimeExecutor ();
138
138
139
139
private:
140
140
void callNativeModules (folly::dynamic &&calls, bool isEndOfBatch);
You can’t perform that action at this time.
0 commit comments