Refactor access of ReactFeatureFlags from C++

Summary:
This diff is a follow up of D28360679 (https://github.com/facebook/react-native/commit/e3367354cc93f17b830ed8dc601dff5e87748dd1), here we refactor the access of ReactFeatureFlags from C++ to use methods instead of fields

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D28362066

fbshipit-source-id: caed5e7fddeb6c0d9846fb037152befa8f1ed5c2
This commit is contained in:
David Vacca
2021-05-11 14:10:47 -07:00
committed by Facebook GitHub Bot
parent 22ddab2025
commit aafdf9fee1
3 changed files with 24 additions and 14 deletions
@@ -60,9 +60,6 @@ public class ReactFeatureFlags {
/** Enables JS Responder in Fabric */
public static boolean enableJSResponder = false;
/** Enables MapBuffer Serialization */
public static boolean mapBufferSerializationEnabled = false;
/** An interface used to compute flags on demand. */
public interface FlagProvider {
boolean get();
@@ -75,6 +72,17 @@ public class ReactFeatureFlags {
enableRuntimeExecutorFlushingProvider = provider;
}
private static boolean mapBufferSerializationEnabled = false;
/** Enables or disables MapBuffer Serialization */
public static void setMapBufferSerializationEnabled(boolean enabled) {
mapBufferSerializationEnabled = enabled;
}
public static boolean isMapBufferSerializationEnabled() {
return mapBufferSerializationEnabled;
}
public static boolean enableRuntimeExecutorFlushing() {
if (enableRuntimeExecutorFlushingProvider != null) {
return enableRuntimeExecutorFlushingProvider.get();