Flutter Engine
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 
9 namespace fml {
10 
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 
21  return task_;
22 }
23 
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
Definition: ascii_trie.cc:9
bool operator>(const DelayedTask &other) const
Definition: delayed_task.cc:28
std::function< void()> closure
Definition: closure.h:14
const fml::closure & GetTask() const
Definition: delayed_task.cc:20
fml::TimePoint GetTargetTime() const
Definition: delayed_task.cc:24
DelayedTask(size_t order, const fml::closure &task, fml::TimePoint target_time)
Definition: delayed_task.cc:11