From ca499a61971de30695b7834fb5a16e09bcfb6074 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Thu, 13 May 2021 08:01:51 -0700 Subject: [PATCH] Group public and private methods in RuntimeScheduler Summary: Changelog: [internal] Only moves methods around so public and private methods are grouped together. Reviewed By: JoshuaGross Differential Revision: D28381588 fbshipit-source-id: dae7f493b99845f66070689270bc7aef958fbecd --- .../runtimescheduler/RuntimeScheduler.cpp | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp b/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp index 88308109049..ca6dcc0fac6 100644 --- a/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp @@ -9,6 +9,8 @@ namespace facebook::react { +#pragma mark - Public + RuntimeScheduler::RuntimeScheduler( RuntimeExecutor const &runtimeExecutor, std::function now) @@ -50,6 +52,28 @@ std::shared_ptr RuntimeScheduler::scheduleTask( return task; } +bool RuntimeScheduler::getShouldYield() const { + return shouldYield_; +} + +void RuntimeScheduler::cancelTask(const std::shared_ptr &task) { + task->callback.reset(); +} + +SchedulerPriority RuntimeScheduler::getCurrentPriorityLevel() const { + return currentPriority_; +} + +RuntimeSchedulerTimePoint RuntimeScheduler::now() const { + return now_(); +} + +void RuntimeScheduler::setEnableYielding(bool enableYielding) { + enableYielding_ = enableYielding; +} + +#pragma mark - Private + void RuntimeScheduler::startWorkLoop(jsi::Runtime &runtime) const { auto previousPriority = currentPriority_; while (!taskQueue_.empty()) { @@ -74,24 +98,4 @@ void RuntimeScheduler::startWorkLoop(jsi::Runtime &runtime) const { currentPriority_ = previousPriority; } -void RuntimeScheduler::cancelTask(const std::shared_ptr &task) { - task->callback.reset(); -} - -bool RuntimeScheduler::getShouldYield() const { - return shouldYield_; -} - -SchedulerPriority RuntimeScheduler::getCurrentPriorityLevel() const { - return currentPriority_; -} - -RuntimeSchedulerTimePoint RuntimeScheduler::now() const { - return now_(); -} - -void RuntimeScheduler::setEnableYielding(bool enableYielding) { - enableYielding_ = enableYielding; -} - } // namespace facebook::react