Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
delayed_task.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#define FML_USED_ON_EMBEDDER
6
7#include "flutter/fml/delayed_task.h"
8
9namespace fml {
10
12 const fml::closure& task,
13 fml::TimePoint target_time,
14 fml::TaskSourceGrade task_source_grade)
15 : order_(order),
16 task_(task),
17 target_time_(target_time),
18 task_source_grade_(task_source_grade) {}
19
21
22DelayedTask::DelayedTask(const DelayedTask& other) = default;
23
25 return task_;
26}
27
29 return target_time_;
30}
31
33 return task_source_grade_;
34}
35
36bool DelayedTask::operator>(const DelayedTask& other) const {
37 if (target_time_ == other.target_time_) {
38 return order_ > other.order_;
39 }
40 return target_time_ > other.target_time_;
41}
42
43} // namespace fml
fml::TimePoint GetTargetTime() const
DelayedTask(size_t order, const fml::closure &task, fml::TimePoint target_time, fml::TaskSourceGrade task_source_grade)
const fml::closure & GetTask() const
fml::TaskSourceGrade GetTaskSourceGrade() const
bool operator>(const DelayedTask &other) const
std::function< void()> closure
Definition closure.h:14