Overview   Project   Class   Tree   Index 
CEF3 C++ API Docs - Version 75.1.4+g4210896+chromium-75.0.3770.100
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

(default)
Class CefThread

CefBaseRefCounted
   |
   +--CefThread

   in cef_thread.h

class CefThread
extends CefBaseRefCounted

A simple thread abstraction that establishes a message loop on a new thread. The consumer uses CefTaskRunner to execute code on the thread's message loop. The thread is terminated when the CefThread object is destroyed or Stop() is called. All pending tasks queued on the thread's message loop will run to completion before the thread is terminated. CreateThread() can be called on any valid CEF thread in either the browser or render process. This class should only be used for tasks that require a dedicated thread. In most cases you can post tasks to an existing CEF thread instead of creating a new one; see cef_task.h for details.


Method Summary
 static CefRefPtr< CefThread > CreateThread( const CefString& display_name )
          Create and start a new thread with default/recommended values.
 static CefRefPtr< CefThread > CreateThread( const CefString& display_name, cef_thread_priority_t priority, cef_message_loop_type_t message_loop_type, bool stoppable, cef_com_init_mode_t com_init_mode )
          Create and start a new thread.
 virtual cef_platform_thread_id_t GetPlatformThreadId()= 0
          Returns the platform thread ID.
 virtual CefRefPtr< CefTaskRunner > GetTaskRunner()= 0
          Returns the CefTaskRunner that will execute code on this thread's message loop.
 virtual bool IsRunning()= 0
          Returns true if the thread is currently running.
 virtual void Stop()= 0
          Stop and join the thread.
   
Methods inherited from class CefBaseRefCounted
AddRef, Release, HasOneRef, HasAtLeastOneRef
 

Method Detail

CreateThread

public static CefRefPtr< CefThread > CreateThread( const CefString& display_name );
Create and start a new thread with default/recommended values. |display_name| is the name that will be used to identify the thread.

CreateThread

public static CefRefPtr< CefThread > CreateThread( const CefString& display_name, cef_thread_priority_t priority, cef_message_loop_type_t message_loop_type, bool stoppable, cef_com_init_mode_t com_init_mode );
Create and start a new thread. This method does not block waiting for the thread to run initialization. |display_name| is the name that will be used to identify the thread. |priority| is the thread execution priority. |message_loop_type| indicates the set of asynchronous events that the thread can process. If |stoppable| is true the thread will stopped and joined on destruction or when Stop() is called; otherwise, the the thread cannot be stopped and will be leaked on shutdown. On Windows the |com_init_mode| value specifies how COM will be initialized for the thread. If |com_init_mode| is set to COM_INIT_MODE_STA then |message_loop_type| must be set to ML_TYPE_UI.

GetPlatformThreadId

public virtual cef_platform_thread_id_t GetPlatformThreadId()= 0;
Returns the platform thread ID. It will return the same value after Stop() is called. This method is safe to call from any thread.

GetTaskRunner

public virtual CefRefPtr< CefTaskRunner > GetTaskRunner()= 0;
Returns the CefTaskRunner that will execute code on this thread's message loop. This method is safe to call from any thread.

IsRunning

public virtual bool IsRunning()= 0;
Returns true if the thread is currently running. This method must be called from the same thread that called CreateThread().

Stop

public virtual void Stop()= 0;
Stop and join the thread. This method must be called from the same thread that called CreateThread(). Do not call this method if CreateThread() was called with a |stoppable| value of false.

 Overview   Project   Class   Tree   Index 
CEF3 C++ API Docs - Version 75.1.4+g4210896+chromium-75.0.3770.100
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

Chromium Embedded Framework (CEF) Copyright © 2016 Marshall A. Greenblatt