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
This commit is contained in:
Samuel Susla 2021-05-13 08:01:51 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 52a995d611
Коммит ca499a6197
1 изменённых файлов: 24 добавлений и 20 удалений

Просмотреть файл

@ -9,6 +9,8 @@
namespace facebook::react {
#pragma mark - Public
RuntimeScheduler::RuntimeScheduler(
RuntimeExecutor const &runtimeExecutor,
std::function<RuntimeSchedulerTimePoint()> now)
@ -50,6 +52,28 @@ std::shared_ptr<Task> RuntimeScheduler::scheduleTask(
return task;
}
bool RuntimeScheduler::getShouldYield() const {
return shouldYield_;
}
void RuntimeScheduler::cancelTask(const std::shared_ptr<Task> &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) {
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