Chromium Embedded Framework (CEF)  126.2.0+g5c56e98+chromium-126.0.6478.62
CefTaskRunner Class Referenceabstract

Class that asynchronously executes tasks on the associated thread. More...

#include "include/cef_task.h"

Inheritance diagram for CefTaskRunner:
CefBaseRefCounted

Public Member Functions

virtual bool IsSame (CefRefPtr< CefTaskRunner > that)=0
 Returns true if this object is pointing to the same task runner as |that| object. More...
 
virtual bool BelongsToCurrentThread ()=0
 Returns true if this task runner belongs to the current thread. More...
 
virtual bool BelongsToThread (CefThreadId threadId)=0
 Returns true if this task runner is for the specified CEF thread. More...
 
virtual bool PostTask (CefRefPtr< CefTask > task)=0
 Post a task for execution on the thread associated with this task runner. More...
 
virtual bool PostDelayedTask (CefRefPtr< CefTask > task, int64_t delay_ms)=0
 Post a task for delayed execution on the thread associated with this task runner. More...
 
- Public Member Functions inherited from CefBaseRefCounted
virtual void AddRef () const =0
 Called to increment the reference count for the object. More...
 
virtual bool Release () const =0
 Called to decrement the reference count for the object. More...
 
virtual bool HasOneRef () const =0
 Returns true if the reference count is 1. More...
 
virtual bool HasAtLeastOneRef () const =0
 Returns true if the reference count is at least 1. More...
 

Static Public Member Functions

static CefRefPtr< CefTaskRunnerGetForCurrentThread ()
 Returns the task runner for the current thread. More...
 
static CefRefPtr< CefTaskRunnerGetForThread (CefThreadId threadId)
 Returns the task runner for the specified CEF thread. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CefBaseRefCounted
virtual ~CefBaseRefCounted ()
 

Detailed Description

Class that asynchronously executes tasks on the associated thread.

It is safe to call the methods of this class on any thread.

CEF maintains multiple internal threads that are used for handling different types of tasks in different processes. The cef_thread_id_t definitions in cef_types.h list the common CEF threads. Task runners are also available for other CEF threads as appropriate (for example, V8 WebWorker threads).

Member Function Documentation

◆ BelongsToCurrentThread()

virtual bool CefTaskRunner::BelongsToCurrentThread ( )
pure virtual

Returns true if this task runner belongs to the current thread.

◆ BelongsToThread()

virtual bool CefTaskRunner::BelongsToThread ( CefThreadId  threadId)
pure virtual

Returns true if this task runner is for the specified CEF thread.

◆ GetForCurrentThread()

static CefRefPtr<CefTaskRunner> CefTaskRunner::GetForCurrentThread ( )
static

Returns the task runner for the current thread.

Only CEF threads will have task runners. An empty reference will be returned if this method is called on an invalid thread.

◆ GetForThread()

static CefRefPtr<CefTaskRunner> CefTaskRunner::GetForThread ( CefThreadId  threadId)
static

Returns the task runner for the specified CEF thread.

◆ IsSame()

virtual bool CefTaskRunner::IsSame ( CefRefPtr< CefTaskRunner that)
pure virtual

Returns true if this object is pointing to the same task runner as |that| object.

◆ PostDelayedTask()

virtual bool CefTaskRunner::PostDelayedTask ( CefRefPtr< CefTask task,
int64_t  delay_ms 
)
pure virtual

Post a task for delayed execution on the thread associated with this task runner.

Execution will occur asynchronously. Delayed tasks are not supported on V8 WebWorker threads and will be executed without the specified delay.

◆ PostTask()

virtual bool CefTaskRunner::PostTask ( CefRefPtr< CefTask task)
pure virtual

Post a task for execution on the thread associated with this task runner.

Execution will occur asynchronously.


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