mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Compile out RuntimeScheduler_Legacy under RCT_REMOVE_LEGACY_ARCH (#57116)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/57116 ## Changelog: [General][Breaking] Compile out RuntimeScheduler_Legacy under RCT_REMOVE_LEGACY_ARCH Guard the legacy RuntimeScheduler implementation behind the `RCT_REMOVE_LEGACY_ARCH` macro instead of deleting it. `RuntimeScheduler_Legacy.h`/`.cpp` remain in the tree, but their contents — along with the feature-flag-based selection between the legacy and modern schedulers in `RuntimeScheduler.cpp`, `NativeMutationObserver.cpp`, and `Task.h` — are wrapped in `#ifndef RCT_REMOVE_LEGACY_ARCH`. When the macro is defined, the legacy code is compiled out and `RuntimeScheduler` unconditionally instantiates `RuntimeScheduler_Modern`; when it is not defined, behavior is unchanged. The C++ API snapshots are updated to drop the `RuntimeScheduler_Legacy` symbols from the new-arch surface, and the parameterized scheduler test (`RuntimeSchedulerTest`) only runs the modern configuration when the legacy arch is compiled out. Reviewed By: rubennorte Differential Revision: D107777881 fbshipit-source-id: 2b50711ab3af182edc45a87fd232d96a0f879837
This commit is contained in:
1 parent
4adca58f4c
commit
d205267a5f
9 files changed
+30
-73
No files matched your search
@@ -4264,30 +4264,6 @@ class facebook::react::RuntimeSchedulerIntersectionObserverDelegate {
|
||||
public virtual ~RuntimeSchedulerIntersectionObserverDelegate() = default;
|
||||
}
|
||||
|
||||
class facebook::react::RuntimeScheduler_Legacy : public facebook::react::RuntimeSchedulerBase {
|
||||
public RuntimeScheduler_Legacy(const facebook::react::RuntimeScheduler_Legacy&) = delete;
|
||||
public RuntimeScheduler_Legacy(facebook::react::RuntimeExecutor runtimeExecutor, std::function<facebook::react::HighResTimeStamp()> now, facebook::react::RuntimeSchedulerTaskErrorHandler onTaskError);
|
||||
public RuntimeScheduler_Legacy(facebook::react::RuntimeScheduler_Legacy&&) = delete;
|
||||
public facebook::react::RuntimeScheduler_Legacy& operator=(const facebook::react::RuntimeScheduler_Legacy&) = delete;
|
||||
public facebook::react::RuntimeScheduler_Legacy& operator=(facebook::react::RuntimeScheduler_Legacy&&) = delete;
|
||||
public virtual bool getShouldYield() noexcept override;
|
||||
public virtual facebook::react::HighResTimeStamp now() const noexcept override;
|
||||
public virtual facebook::react::SchedulerPriority getCurrentPriorityLevel() const noexcept override;
|
||||
public virtual std::shared_ptr<facebook::react::Task> scheduleIdleTask(facebook::jsi::Function&& callback, facebook::react::HighResDuration timeout = timeoutForSchedulerPriority(facebook::react::SchedulerPriority::IdlePriority)) noexcept override;
|
||||
public virtual std::shared_ptr<facebook::react::Task> scheduleIdleTask(facebook::react::RawCallback&& callback, facebook::react::HighResDuration timeout = timeoutForSchedulerPriority(facebook::react::SchedulerPriority::IdlePriority)) noexcept override;
|
||||
public virtual std::shared_ptr<facebook::react::Task> scheduleTask(facebook::react::SchedulerPriority priority, facebook::jsi::Function&& callback) noexcept override;
|
||||
public virtual std::shared_ptr<facebook::react::Task> scheduleTask(facebook::react::SchedulerPriority priority, facebook::react::RawCallback&& callback) noexcept override;
|
||||
public virtual void callExpiredTasks(facebook::jsi::Runtime& runtime) override;
|
||||
public virtual void cancelTask(facebook::react::Task& task) noexcept override;
|
||||
public virtual void executeNowOnTheSameThread(facebook::react::RawCallback&& callback) override;
|
||||
public virtual void scheduleRenderingUpdate(facebook::react::SurfaceId surfaceId, facebook::react::RuntimeSchedulerRenderingUpdate&& renderingUpdate) override;
|
||||
public virtual void scheduleWork(facebook::react::RawCallback&& callback) noexcept override;
|
||||
public virtual void setEventTimingDelegate(facebook::react::RuntimeSchedulerEventTimingDelegate* eventTimingDelegate) override;
|
||||
public virtual void setIntersectionObserverDelegate(facebook::react::RuntimeSchedulerIntersectionObserverDelegate* intersectionObserverDelegate) override;
|
||||
public virtual void setPerformanceEntryReporter(facebook::react::PerformanceEntryReporter* performanceEntryReporter) override;
|
||||
public virtual void setShadowTreeRevisionConsistencyManager(facebook::react::ShadowTreeRevisionConsistencyManager* shadowTreeRevisionConsistencyManager) override;
|
||||
}
|
||||
|
||||
class facebook::react::RuntimeScheduler_Modern : public facebook::react::RuntimeSchedulerBase {
|
||||
public RuntimeScheduler_Modern(const facebook::react::RuntimeScheduler_Modern&) = delete;
|
||||
public RuntimeScheduler_Modern(facebook::react::RuntimeExecutor runtimeExecutor, std::function<facebook::react::HighResTimeStamp()> now, facebook::react::RuntimeSchedulerTaskErrorHandler onTaskError);
|
||||
|
||||
@@ -6495,30 +6495,6 @@ class facebook::react::RuntimeSchedulerIntersectionObserverDelegate {
|
||||
public virtual ~RuntimeSchedulerIntersectionObserverDelegate() = default;
|
||||
}
|
||||
|
||||
class facebook::react::RuntimeScheduler_Legacy : public facebook::react::RuntimeSchedulerBase {
|
||||
public RuntimeScheduler_Legacy(const facebook::react::RuntimeScheduler_Legacy&) = delete;
|
||||
public RuntimeScheduler_Legacy(facebook::react::RuntimeExecutor runtimeExecutor, std::function<facebook::react::HighResTimeStamp()> now, facebook::react::RuntimeSchedulerTaskErrorHandler onTaskError);
|
||||
public RuntimeScheduler_Legacy(facebook::react::RuntimeScheduler_Legacy&&) = delete;
|
||||
public facebook::react::RuntimeScheduler_Legacy& operator=(const facebook::react::RuntimeScheduler_Legacy&) = delete;
|
||||
public facebook::react::RuntimeScheduler_Legacy& operator=(facebook::react::RuntimeScheduler_Legacy&&) = delete;
|
||||
public virtual bool getShouldYield() noexcept override;
|
||||
public virtual facebook::react::HighResTimeStamp now() const noexcept override;
|
||||
public virtual facebook::react::SchedulerPriority getCurrentPriorityLevel() const noexcept override;
|
||||
public virtual std::shared_ptr<facebook::react::Task> scheduleIdleTask(facebook::jsi::Function&& callback, facebook::react::HighResDuration timeout = timeoutForSchedulerPriority(facebook::react::SchedulerPriority::IdlePriority)) noexcept override;
|
||||
public virtual std::shared_ptr<facebook::react::Task> scheduleIdleTask(facebook::react::RawCallback&& callback, facebook::react::HighResDuration timeout = timeoutForSchedulerPriority(facebook::react::SchedulerPriority::IdlePriority)) noexcept override;
|
||||
public virtual std::shared_ptr<facebook::react::Task> scheduleTask(facebook::react::SchedulerPriority priority, facebook::jsi::Function&& callback) noexcept override;
|
||||
public virtual std::shared_ptr<facebook::react::Task> scheduleTask(facebook::react::SchedulerPriority priority, facebook::react::RawCallback&& callback) noexcept override;
|
||||
public virtual void callExpiredTasks(facebook::jsi::Runtime& runtime) override;
|
||||
public virtual void cancelTask(facebook::react::Task& task) noexcept override;
|
||||
public virtual void executeNowOnTheSameThread(facebook::react::RawCallback&& callback) override;
|
||||
public virtual void scheduleRenderingUpdate(facebook::react::SurfaceId surfaceId, facebook::react::RuntimeSchedulerRenderingUpdate&& renderingUpdate) override;
|
||||
public virtual void scheduleWork(facebook::react::RawCallback&& callback) noexcept override;
|
||||
public virtual void setEventTimingDelegate(facebook::react::RuntimeSchedulerEventTimingDelegate* eventTimingDelegate) override;
|
||||
public virtual void setIntersectionObserverDelegate(facebook::react::RuntimeSchedulerIntersectionObserverDelegate* intersectionObserverDelegate) override;
|
||||
public virtual void setPerformanceEntryReporter(facebook::react::PerformanceEntryReporter* performanceEntryReporter) override;
|
||||
public virtual void setShadowTreeRevisionConsistencyManager(facebook::react::ShadowTreeRevisionConsistencyManager* shadowTreeRevisionConsistencyManager) override;
|
||||
}
|
||||
|
||||
class facebook::react::RuntimeScheduler_Modern : public facebook::react::RuntimeSchedulerBase {
|
||||
public RuntimeScheduler_Modern(const facebook::react::RuntimeScheduler_Modern&) = delete;
|
||||
public RuntimeScheduler_Modern(facebook::react::RuntimeExecutor runtimeExecutor, std::function<facebook::react::HighResTimeStamp()> now, facebook::react::RuntimeSchedulerTaskErrorHandler onTaskError);
|
||||
|
||||
@@ -2871,30 +2871,6 @@ class facebook::react::RuntimeSchedulerIntersectionObserverDelegate {
|
||||
public virtual ~RuntimeSchedulerIntersectionObserverDelegate() = default;
|
||||
}
|
||||
|
||||
class facebook::react::RuntimeScheduler_Legacy : public facebook::react::RuntimeSchedulerBase {
|
||||
public RuntimeScheduler_Legacy(const facebook::react::RuntimeScheduler_Legacy&) = delete;
|
||||
public RuntimeScheduler_Legacy(facebook::react::RuntimeExecutor runtimeExecutor, std::function<facebook::react::HighResTimeStamp()> now, facebook::react::RuntimeSchedulerTaskErrorHandler onTaskError);
|
||||
public RuntimeScheduler_Legacy(facebook::react::RuntimeScheduler_Legacy&&) = delete;
|
||||
public facebook::react::RuntimeScheduler_Legacy& operator=(const facebook::react::RuntimeScheduler_Legacy&) = delete;
|
||||
public facebook::react::RuntimeScheduler_Legacy& operator=(facebook::react::RuntimeScheduler_Legacy&&) = delete;
|
||||
public virtual bool getShouldYield() noexcept override;
|
||||
public virtual facebook::react::HighResTimeStamp now() const noexcept override;
|
||||
public virtual facebook::react::SchedulerPriority getCurrentPriorityLevel() const noexcept override;
|
||||
public virtual std::shared_ptr<facebook::react::Task> scheduleIdleTask(facebook::jsi::Function&& callback, facebook::react::HighResDuration timeout = timeoutForSchedulerPriority(facebook::react::SchedulerPriority::IdlePriority)) noexcept override;
|
||||
public virtual std::shared_ptr<facebook::react::Task> scheduleIdleTask(facebook::react::RawCallback&& callback, facebook::react::HighResDuration timeout = timeoutForSchedulerPriority(facebook::react::SchedulerPriority::IdlePriority)) noexcept override;
|
||||
public virtual std::shared_ptr<facebook::react::Task> scheduleTask(facebook::react::SchedulerPriority priority, facebook::jsi::Function&& callback) noexcept override;
|
||||
public virtual std::shared_ptr<facebook::react::Task> scheduleTask(facebook::react::SchedulerPriority priority, facebook::react::RawCallback&& callback) noexcept override;
|
||||
public virtual void callExpiredTasks(facebook::jsi::Runtime& runtime) override;
|
||||
public virtual void cancelTask(facebook::react::Task& task) noexcept override;
|
||||
public virtual void executeNowOnTheSameThread(facebook::react::RawCallback&& callback) override;
|
||||
public virtual void scheduleRenderingUpdate(facebook::react::SurfaceId surfaceId, facebook::react::RuntimeSchedulerRenderingUpdate&& renderingUpdate) override;
|
||||
public virtual void scheduleWork(facebook::react::RawCallback&& callback) noexcept override;
|
||||
public virtual void setEventTimingDelegate(facebook::react::RuntimeSchedulerEventTimingDelegate* eventTimingDelegate) override;
|
||||
public virtual void setIntersectionObserverDelegate(facebook::react::RuntimeSchedulerIntersectionObserverDelegate* intersectionObserverDelegate) override;
|
||||
public virtual void setPerformanceEntryReporter(facebook::react::PerformanceEntryReporter* performanceEntryReporter) override;
|
||||
public virtual void setShadowTreeRevisionConsistencyManager(facebook::react::ShadowTreeRevisionConsistencyManager* shadowTreeRevisionConsistencyManager) override;
|
||||
}
|
||||
|
||||
class facebook::react::RuntimeScheduler_Modern : public facebook::react::RuntimeSchedulerBase {
|
||||
public RuntimeScheduler_Modern(const facebook::react::RuntimeScheduler_Modern&) = delete;
|
||||
public RuntimeScheduler_Modern(facebook::react::RuntimeExecutor runtimeExecutor, std::function<facebook::react::HighResTimeStamp()> now, facebook::react::RuntimeSchedulerTaskErrorHandler onTaskError);
|
||||
|
||||
Reference in new issue
Block a user