# Class TCefTaskManagerRef

Description
Hierarchy
Methods

## Unit

uCEFTaskManager

## Declaration

`type TCefTaskManagerRef = class(TCefBaseRefCountedRef, ICefTaskManager)`

## Description

Class that facilitates managing the browser-related tasks.

The functions of this class may only be called on the CEF UI thread.

UNKNOWN

<see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_task_manager_capi.h">CEF source file: /include/capi/cef_task_manager_capi.h (cef_task_manager_t))

## Hierarchy

- TInterfacedObject
- TCefBaseRefCountedRef
- TCefTaskManagerRef

## Overview

### Methods

Protected | `function GetTasksCount: NativeUInt;`
Protected | `function GetTaskIdsList(var task_ids: TCefCustomInt64Array): boolean;`
Protected | `function GetTaskInfo(const task_id: int64; var info: TCustomTaskInfo): boolean;`
Protected | `function KillTask(task_id: int64): boolean;`
Protected | `function GetTaskIdForBrowserId(browser_id: Integer): int64;`
Public | `class function UnWrap(data: Pointer): ICefTaskManager;`
Public | `class function New(): ICefTaskManager;`

## Description

### Methods

Protected | `function GetTasksCount: NativeUInt;`
Returns the number of tasks currently tracked by the task manager. Returns 0 if the function was called from the incorrect thread. This function may only be called on the CEF UI thread.

Protected | `function GetTaskIdsList(var task_ids: TCefCustomInt64Array): boolean;`
Gets the list of task IDs currently tracked by the task manager. Tasks that share the same process id will always be consecutive. The list will be sorted in a way that reflects the process tree: the browser process will be first, followed by the gpu process if it exists. Related processes (e.g., a subframe process and its parent) will be kept together if possible. Callers can expect this ordering to be stable when a process is added or removed. The task IDs are unique within the application lifespan. Returns false (0) if the function was called from the incorrect thread. This function may only be called on the CEF UI thread.

Protected | `function GetTaskInfo(const task_id: int64; var info: TCustomTaskInfo): boolean;`
Gets information about the task with |task_id|. Returns true (1) if the information about the task was successfully retrieved and false (0) if the |task_id| is invalid or the function was called from the incorrect thread. This function may only be called on the CEF UI thread.

Protected | `function KillTask(task_id: int64): boolean;`
Attempts to terminate a task with |task_id|. Returns false (0) if the |task_id| is invalid, the call is made from an incorrect thread, or if the task cannot be terminated. This function may only be called on the CEF UI thread.

Protected | `function GetTaskIdForBrowserId(browser_id: Integer): int64;`
Returns the task ID associated with the main task for |browser_id| (value from cef_browser_t::GetIdentifier). Returns -1 if |browser_id| is invalid, does not currently have an associated task, or the function was called from the incorrect thread. This function may only be called on the CEF UI thread.

Public | `class function UnWrap(data: Pointer): ICefTaskManager;`
This item has no description.

Public | `class function New(): ICefTaskManager;`
Returns the global task manager. This function may only be called on the CEF UI thread.

Generated by PasDoc 1.0.4.