Flutter Engine
flutter_runner::CompatTaskRunner Class Reference
Inheritance diagram for flutter_runner::CompatTaskRunner:
fml::TaskRunner fml::RefCountedThreadSafe< TaskRunner > fml::internal::RefCountedThreadSafeBase

Public Member Functions

 CompatTaskRunner (async_dispatcher_t *dispatcher)
 
void PostTask (const fml::closure &task) override
 
void PostTaskForTime (const fml::closure &task, fml::TimePoint target_time) override
 
void PostDelayedTask (const fml::closure &task, fml::TimeDelta delay) override
 
bool RunsTasksOnCurrentThread () override
 
- Public Member Functions inherited from fml::TaskRunner
virtual ~TaskRunner ()
 
virtual TaskQueueId GetTaskQueueId ()
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< TaskRunner >
void Release () const
 
- Public Member Functions inherited from fml::internal::RefCountedThreadSafeBase
void AddRef () const
 
bool HasOneRef () const
 
void AssertHasOneRef () const
 

Additional Inherited Members

- Static Public Member Functions inherited from fml::TaskRunner
static void RunNowOrPostTask (fml::RefPtr< fml::TaskRunner > runner, const fml::closure &task)
 
- Protected Member Functions inherited from fml::TaskRunner
 TaskRunner (fml::RefPtr< MessageLoopImpl > loop)
 
- Protected Member Functions inherited from fml::RefCountedThreadSafe< TaskRunner >
 RefCountedThreadSafe ()
 
 ~RefCountedThreadSafe ()
 
- Protected Member Functions inherited from fml::internal::RefCountedThreadSafeBase
 RefCountedThreadSafeBase ()
 
 ~RefCountedThreadSafeBase ()
 
bool Release () const
 
void Adopt ()
 

Detailed Description

Definition at line 15 of file task_runner_adapter.cc.

Constructor & Destructor Documentation

◆ CompatTaskRunner()

flutter_runner::CompatTaskRunner::CompatTaskRunner ( async_dispatcher_t *  dispatcher)
inline

Definition at line 17 of file task_runner_adapter.cc.

References FML_DCHECK.

18  : fml::TaskRunner(nullptr), forwarding_target_(dispatcher) {
19  FML_DCHECK(forwarding_target_);
20  }
#define FML_DCHECK(condition)
Definition: logging.h:86

Member Function Documentation

◆ PostDelayedTask()

void flutter_runner::CompatTaskRunner::PostDelayedTask ( const fml::closure task,
fml::TimeDelta  delay 
)
inlineoverridevirtual

Reimplemented from fml::TaskRunner.

Definition at line 33 of file task_runner_adapter.cc.

References fml::TimeDelta::ToNanoseconds().

34  {
35  async::PostDelayedTask(forwarding_target_, task,
36  zx::duration(delay.ToNanoseconds()));
37  }
constexpr int64_t ToNanoseconds() const
Definition: time_delta.h:61

◆ PostTask()

void flutter_runner::CompatTaskRunner::PostTask ( const fml::closure task)
inlineoverridevirtual

Reimplemented from fml::TaskRunner.

Definition at line 22 of file task_runner_adapter.cc.

22  {
23  async::PostTask(forwarding_target_, task);
24  }

◆ PostTaskForTime()

void flutter_runner::CompatTaskRunner::PostTaskForTime ( const fml::closure task,
fml::TimePoint  target_time 
)
inlineoverridevirtual

Reimplemented from fml::TaskRunner.

Definition at line 26 of file task_runner_adapter.cc.

References fml::TimePoint::ToEpochDelta(), and fml::TimeDelta::ToNanoseconds().

27  {
28  async::PostTaskForTime(
29  forwarding_target_, task,
30  zx::time(target_time.ToEpochDelta().ToNanoseconds()));
31  }
TimeDelta ToEpochDelta() const
Definition: time_point.h:40
constexpr int64_t ToNanoseconds() const
Definition: time_delta.h:61

◆ RunsTasksOnCurrentThread()

bool flutter_runner::CompatTaskRunner::RunsTasksOnCurrentThread ( )
inlineoverridevirtual

Reimplemented from fml::TaskRunner.

Definition at line 39 of file task_runner_adapter.cc.

39  {
40  return forwarding_target_ == async_get_default_dispatcher();
41  }

The documentation for this class was generated from the following file: