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:
Родитель
52a995d611
Коммит
ca499a6197
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче