Skip to content

Commit

Permalink
Fix Runnables used with enableEarlyScheduledMountItemExecution being …
Browse files Browse the repository at this point in the history
…unguarded (#38038)

Summary:
Pull Request resolved: #38038

Changelog: [Internal]

Also un-deprecating the constructors of other Guarded runnables, as an extension of D46685374

Reviewed By: rshest

Differential Revision: D46971220

fbshipit-source-id: cf982f7efe9bcd1ddb7285aa35d836b7c57c4d24
  • Loading branch information
javache authored and facebook-github-bot committed Jun 23, 2023
1 parent 9e1c3d2 commit 330639f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public abstract class GuardedResultAsyncTask<Result> extends AsyncTask<Void, Voi

private final JSExceptionHandler mExceptionHandler;

@Deprecated
protected GuardedResultAsyncTask(ReactContext reactContext) {
this(reactContext.getExceptionHandler());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public abstract class GuardedRunnable implements Runnable {

private final JSExceptionHandler mExceptionHandler;

@Deprecated
public GuardedRunnable(ReactContext reactContext) {
this(reactContext.getExceptionHandler());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.facebook.infer.annotation.ThreadConfined;
import com.facebook.proguard.annotations.DoNotStripAny;
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.GuardedRunnable;
import com.facebook.react.bridge.LifecycleEventListener;
import com.facebook.react.bridge.NativeArray;
import com.facebook.react.bridge.NativeMap;
Expand Down Expand Up @@ -785,9 +786,9 @@ private void scheduleMountItem(
if (shouldSchedule) {
mMountItemDispatcher.addMountItem(mountItem);
Runnable runnable =
new Runnable() {
new GuardedRunnable(mReactApplicationContext) {
@Override
public void run() {
public void runGuarded() {
mMountItemDispatcher.tryDispatchMountItems();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public abstract class GuardedFrameCallback extends ChoreographerCompat.FrameCall

@NonNull private final JSExceptionHandler mExceptionHandler;

@Deprecated
protected GuardedFrameCallback(@NonNull ReactContext reactContext) {
this(reactContext.getExceptionHandler());
}
Expand Down

0 comments on commit 330639f

Please sign in to comment.