# Interface ICefResourceHandler

Description
Hierarchy
Methods

## Unit

uCEFInterfaces

## Declaration

`type ICefResourceHandler = interface(ICefBaseRefCounted)`

## Description

Interface used to implement a custom request handler interface. The functions of this interface will be called on the IO thread unless otherwise indicated.

UNKNOWN

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

## Hierarchy

- IInterface
- ICefBaseRefCounted
- ICefResourceHandler

## Overview

### Methods

Public | `function open(const request: ICefRequest; var handle_request: boolean; const callback: ICefCallback): boolean;`
Public | `function ProcessRequest(const request: ICefRequest; const callback: ICefCallback): boolean;`
Public | `procedure GetResponseHeaders(const response: ICefResponse; out responseLength: Int64; out redirectUrl: ustring);`
Public | `function skip(bytes_to_skip: int64; var bytes_skipped: Int64; const callback: ICefResourceSkipCallback): boolean;`
Public | `function read(const data_out: Pointer; bytes_to_read: Integer; var bytes_read: Integer; const callback: ICefResourceReadCallback): boolean;`
Public | `function ReadResponse(const dataOut: Pointer; bytesToRead: Integer; var bytesRead: Integer; const callback: ICefCallback): boolean;`
Public | `procedure Cancel;`

## Description

### Methods

Public | `function open(const request: ICefRequest; var handle_request: boolean; const callback: ICefCallback): boolean;`
Open the response stream. To handle the request immediately set |handle_request| to true (1) and return true (1). To decide at a later time set |handle_request| to false (0), return true (1), and execute |callback| to continue or cancel the request. To cancel the request immediately set |handle_request| to true (1) and return false (0). This function will be called in sequence but not from a dedicated thread. For backwards compatibility set |handle_request| to false (0) and return false (0) and the ProcessRequest function will be called. ###### Attributes GUID['{BD3EA208-AAAD-488C-BFF2-76993022F2B5}']

Public | `function ProcessRequest(const request: ICefRequest; const callback: ICefCallback): boolean;`
Begin processing the request. To handle the request return true (1) and call ICefCallback.cont() once the response header information is available (ICefCallback.cont() can also be called from inside this function if header information is available immediately). To cancel the request return false (0). WARNING: This function is deprecated. Use Open instead.

Public | `procedure GetResponseHeaders(const response: ICefResponse; out responseLength: Int64; out redirectUrl: ustring);`
Retrieve response header information. If the response length is not known set |response_length| to -1 and read_response() will be called until it returns false (0). If the response length is known set |response_length| to a positive value and read_response() will be called until it returns false (0) or the specified number of bytes have been read. Use the |response| object to set the mime type, http status code and other optional header values. To redirect the request to a new URL set |redirectUrl| to the new URL. |redirectUrl| can be either a relative or fully qualified URL. It is also possible to set |response| to a redirect http status code and pass the new URL via a Location header. Likewise with |redirectUrl| it is valid to set a relative or fully qualified URL as the Location header value. If an error occured while setting up the request you can call set_error() on |response| to indicate the error condition.

Public | `function skip(bytes_to_skip: int64; var bytes_skipped: Int64; const callback: ICefResourceSkipCallback): boolean;`
Skip response data when requested by a Range header. Skip over and discard |bytes_to_skip| bytes of response data. If data is available immediately set |bytes_skipped| to the number of bytes skipped and return true (1). To read the data at a later time set |bytes_skipped| to 0, return true (1) and execute |callback| when the data is available. To indicate failure set |bytes_skipped| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This function will be called in sequence but not from a dedicated thread.

Public | `function read(const data_out: Pointer; bytes_to_read: Integer; var bytes_read: Integer; const callback: ICefResourceReadCallback): boolean;`
Read response data. If data is available immediately copy up to |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of bytes copied, and return true (1). To read the data at a later time keep a pointer to |data_out|, set |bytes_read| to 0, return true (1) and execute |callback| when the data is available (|data_out| will remain valid until the callback is executed). To indicate response completion set |bytes_read| to 0 and return false (0). To indicate failure set |bytes_read| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This function will be called in sequence but not from a dedicated thread. For backwards compatibility set |bytes_read| to -1 and return false (0) and the ReadResponse function will be called.

Public | `function ReadResponse(const dataOut: Pointer; bytesToRead: Integer; var bytesRead: Integer; const callback: ICefCallback): boolean;`
Read response data. If data is available immediately copy up to |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of bytes copied, and return true (1). To read the data at a later time set |bytes_read| to 0, return true (1) and call ICefCallback.cont() when the data is available. To indicate response completion return false (0). WARNING: This function is deprecated. Use Skip and Read instead.

Public | `procedure Cancel;`
Request processing has been canceled.

Generated by PasDoc 1.0.4.