mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Wire up RuntimeExecutorFlushing to MobileConfig
Summary: With D27975839, RuntimeExecutor will be able to start flushing the queued up NativeModule calls in every call from C++ -> JavaScript. We're going to test this feature to measure its impact. In this diff, I wire up the the MobileConfig to ReactFeatureFlags. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D27978112 fbshipit-source-id: 47e1e74398c62755bb0fdc6b54b7fd3aa47eb877
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c0ec82e61e
commit
d48c2be46f
@@ -551,7 +551,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
|
||||
@Override
|
||||
public RuntimeExecutor getRuntimeExecutor() {
|
||||
return getRuntimeExecutor(false);
|
||||
return getRuntimeExecutor(ReactFeatureFlags.enableRuntimeExecutorFlushing());
|
||||
}
|
||||
|
||||
public native RuntimeExecutor getRuntimeExecutor(boolean shouldFlush);
|
||||
|
||||
@@ -72,4 +72,24 @@ public class ReactFeatureFlags {
|
||||
|
||||
/** Enables MapBuffer Serialization */
|
||||
public static boolean mapBufferSerializationEnabled = false;
|
||||
|
||||
/** An interface used to compute flags on demand. */
|
||||
public interface FlagProvider {
|
||||
boolean get();
|
||||
}
|
||||
|
||||
/** Should the RuntimeExecutor call JSIExecutor::flush()? */
|
||||
private static FlagProvider enableRuntimeExecutorFlushingProvider = null;
|
||||
|
||||
public static void setEnableRuntimeExecutorFlushingFlagProvider(FlagProvider provider) {
|
||||
enableRuntimeExecutorFlushingProvider = provider;
|
||||
}
|
||||
|
||||
public static boolean enableRuntimeExecutorFlushing() {
|
||||
if (enableRuntimeExecutorFlushingProvider != null) {
|
||||
return enableRuntimeExecutorFlushingProvider.get();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user