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 | |
9 | namespace fml { |
10 | |
11 | DelayedTask::DelayedTask(size_t order, |
12 | const fml::closure& task, |
13 | fml::TimePoint target_time) |
14 | : order_(order), task_(task), target_time_(target_time) {} |
15 | |
16 | DelayedTask::DelayedTask(const DelayedTask& other) = default; |
17 | |
18 | DelayedTask::~DelayedTask() = default; |
19 | |
20 | const fml::closure& DelayedTask::GetTask() const { |
21 | return task_; |
22 | } |
23 | |
24 | fml::TimePoint DelayedTask::GetTargetTime() const { |
25 | return target_time_; |
26 | } |
27 | |
28 | bool DelayedTask::operator>(const DelayedTask& other) const { |
29 | if (target_time_ == other.target_time_) { |
30 | return order_ > other.order_; |
31 | } |
32 | return target_time_ > other.target_time_; |
33 | } |
34 | |
35 | } // namespace fml |
36 |