From d6f9adeaecfa0f0f51ea6237d698a1ee6ed7669d Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Thu, 13 Oct 2022 10:19:28 -0700 Subject: [PATCH] Remove enable_delayed_view_state_deletion_android feature flag Summary: changelog: [internal] Reviewed By: mdvacca Differential Revision: D40299970 fbshipit-source-id: 2569b55450cdb06952316c97a8f77b97ead6ebf4 --- .../react/config/ReactFeatureFlags.java | 2 - .../mounting/SurfaceMountingManager.java | 50 ++----------------- .../mountitems/IntBufferBatchMountItem.java | 2 - 3 files changed, 5 insertions(+), 49 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java index e9ad457d3e..0c7003d8ce 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +++ b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java @@ -95,8 +95,6 @@ public class ReactFeatureFlags { public static boolean insertZReorderBarriersOnViewGroupChildren = true; /** Feature Flag for mitigatin concurrent root crashes */ - public static boolean enableDelayedViewStateDeletion = false; - public static boolean disablePreallocationOnClone = false; public static boolean shouldRememberAllocatedViews = false; diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java index 90096f4ada..a7abe4ec6b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java @@ -93,14 +93,6 @@ public class SurfaceMountingManager { // This is null *until* StopSurface is called. private Set mTagSetForStoppedSurface; - // C++ layer checks for prop revision and doesn't - // dispatch createView mount item if view pre-allocation mount item was dispatched. - // This leads to missing createView and pre-mature deletion of ViewState. - // To work around this issue, ViewState deletion is delayed until subsequent commit. - // If the subsequent commit accesses ViewState, it won't be deleted. - private Set mSoftDeletedViewStateTags; - private Set mScheduledForDeletionViewStateTags; - private final int mSurfaceId; public SurfaceMountingManager( @@ -117,11 +109,6 @@ public class SurfaceMountingManager { mRootViewManager = rootViewManager; mMountItemExecutor = mountItemExecutor; mThemedReactContext = reactContext; - - if (ReactFeatureFlags.enableDelayedViewStateDeletion) { - mSoftDeletedViewStateTags = new HashSet(); - mScheduledForDeletionViewStateTags = new HashSet(); - } } public boolean isStopped() { @@ -1188,23 +1175,6 @@ public class SurfaceMountingManager { } } - @UiThread - public void didUpdateViews() { - if (ReactFeatureFlags.enableDelayedViewStateDeletion) { - for (Integer reactTag : mScheduledForDeletionViewStateTags) { - // To delete we simply remove the tag from the registry. - // We want to rely on the correct set of MountInstructions being sent to the platform, - // or StopSurface being called, so we do not handle deleting descendents of the View. - ViewState viewState = mTagToViewState.remove(reactTag); - if (viewState != null) { - onViewStateDeleted(viewState); - } - } - mScheduledForDeletionViewStateTags = mSoftDeletedViewStateTags; - mSoftDeletedViewStateTags = new HashSet(); - } - } - @UiThread public void deleteView(int reactTag) { UiThreadUtil.assertOnUiThread(); @@ -1222,16 +1192,12 @@ public class SurfaceMountingManager { return; } - if (ReactFeatureFlags.enableDelayedViewStateDeletion) { - mSoftDeletedViewStateTags.add(reactTag); - } else { - // To delete we simply remove the tag from the registry. - // We want to rely on the correct set of MountInstructions being sent to the platform, - // or StopSurface being called, so we do not handle deleting descendents of the View. - mTagToViewState.remove(reactTag); + // To delete we simply remove the tag from the registry. + // We want to rely on the correct set of MountInstructions being sent to the platform, + // or StopSurface being called, so we do not handle deleting descendents of the View. + mTagToViewState.remove(reactTag); - onViewStateDeleted(viewState); - } + onViewStateDeleted(viewState); } @UiThread @@ -1281,9 +1247,6 @@ public class SurfaceMountingManager { throw new RetryableMountingLayerException( "Unable to find viewState for tag " + tag + ". Surface stopped: " + isStopped()); } - if (ReactFeatureFlags.enableDelayedViewStateDeletion) { - mScheduledForDeletionViewStateTags.remove(tag); - } return viewState; } @@ -1292,9 +1255,6 @@ public class SurfaceMountingManager { if (viewStates == null) { return null; } - if (ReactFeatureFlags.enableDelayedViewStateDeletion) { - mScheduledForDeletionViewStateTags.remove(tag); - } return viewStates.get(tag); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java index c6c3396eb7..f5bc56dd52 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java @@ -193,8 +193,6 @@ public class IntBufferBatchMountItem implements MountItem { } } - surfaceMountingManager.didUpdateViews(); - endMarkers(); }