_cef_resource_request_handler_t

Struct _cef_resource_request_handler_t 

Source
#[repr(C)]
pub struct _cef_resource_request_handler_t { pub base: cef_base_ref_counted_t, pub get_cookie_access_filter: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t) -> *mut _cef_cookie_access_filter_t>, pub on_before_resource_load: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, callback: *mut _cef_callback_t) -> cef_return_value_t>, pub get_resource_handler: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t) -> *mut _cef_resource_handler_t>, pub on_resource_redirect: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, response: *mut _cef_response_t, new_url: *mut cef_string_t)>, pub on_resource_response: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, response: *mut _cef_response_t) -> c_int>, pub get_resource_response_filter: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, response: *mut _cef_response_t) -> *mut _cef_response_filter_t>, pub on_resource_load_complete: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, response: *mut _cef_response_t, status: cef_urlrequest_status_t, received_content_length: i64)>, pub on_protocol_execution: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, allow_os_execution: *mut c_int)>, }
Expand description

Implement this structure to handle events related to browser requests. The functions of this structure will be called on the IO thread unless otherwise indicated.

Fields§

§base: cef_base_ref_counted_t

Base structure.

§get_cookie_access_filter: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t) -> *mut _cef_cookie_access_filter_t>

Called on the IO thread before a resource request is loaded. The |browser| and |frame| values represent the source of the request, and may be NULL for requests originating from service workers or cef_urlrequest_t. To optionally filter cookies for the request return a cef_cookie_access_filter_t object. The |request| object cannot not be modified in this callback.

§on_before_resource_load: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, callback: *mut _cef_callback_t) -> cef_return_value_t>

Called on the IO thread before a resource request is loaded. The |browser| and |frame| values represent the source of the request, and may be NULL for requests originating from service workers or cef_urlrequest_t. To redirect or change the resource load optionally modify |request|. Modification of the request URL will be treated as a redirect. Return RV_CONTINUE to continue the request immediately. Return RV_CONTINUE_ASYNC and call cef_callback_t functions at a later time to continue or cancel the request asynchronously. Return RV_CANCEL to cancel the request immediately.

§get_resource_handler: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t) -> *mut _cef_resource_handler_t>

Called on the IO thread before a resource is loaded. The |browser| and |frame| values represent the source of the request, and may be NULL for requests originating from service workers or cef_urlrequest_t. To allow the resource to load using the default network loader return NULL. To specify a handler for the resource return a cef_resource_handler_t object. The |request| object cannot not be modified in this callback.

§on_resource_redirect: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, response: *mut _cef_response_t, new_url: *mut cef_string_t)>

Called on the IO thread when a resource load is redirected. The |browser| and |frame| values represent the source of the request, and may be NULL for requests originating from service workers or cef_urlrequest_t. The |request| parameter will contain the old URL and other request-related information. The |response| parameter will contain the response that resulted in the redirect. The |new_url| parameter will contain the new URL and can be changed if desired. The |request| and |response| objects cannot be modified in this callback.

§on_resource_response: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, response: *mut _cef_response_t) -> c_int>

Called on the IO thread when a resource response is received. The |browser| and |frame| values represent the source of the request, and may be NULL for requests originating from service workers or cef_urlrequest_t. To allow the resource load to proceed without modification return false (0). To redirect or retry the resource load optionally modify |request| and return true (1). Modification of the request URL will be treated as a redirect. Requests handled using the default network loader cannot be redirected in this callback. The |response| object cannot be modified in this callback.

WARNING: Redirecting using this function is deprecated. Use OnBeforeResourceLoad or GetResourceHandler to perform redirects.

§get_resource_response_filter: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, response: *mut _cef_response_t) -> *mut _cef_response_filter_t>

Called on the IO thread to optionally filter resource response content. The |browser| and |frame| values represent the source of the request, and may be NULL for requests originating from service workers or cef_urlrequest_t. |request| and |response| represent the request and response respectively and cannot be modified in this callback.

§on_resource_load_complete: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, response: *mut _cef_response_t, status: cef_urlrequest_status_t, received_content_length: i64)>

Called on the IO thread when a resource load has completed. The |browser| and |frame| values represent the source of the request, and may be NULL for requests originating from service workers or cef_urlrequest_t. |request| and |response| represent the request and response respectively and cannot be modified in this callback. |status| indicates the load completion status. |received_content_length| is the number of response bytes actually read. This function will be called for all requests, including requests that are aborted due to CEF shutdown or destruction of the associated browser. In cases where the associated browser is destroyed this callback may arrive after the cef_life_span_handler_t::OnBeforeClose callback for that browser. The cef_frame_t::IsValid function can be used to test for this situation, and care should be taken not to call |browser| or |frame| functions that modify state (like LoadURL, SendProcessMessage, etc.) if the frame is invalid.

§on_protocol_execution: Option<unsafe extern "C" fn(self_: *mut _cef_resource_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, allow_os_execution: *mut c_int)>

Called on the IO thread to handle requests for URLs with an unknown protocol component. The |browser| and |frame| values represent the source of the request, and may be NULL for requests originating from service workers or cef_urlrequest_t. |request| cannot be modified in this callback. Set |allow_os_execution| to true (1) to attempt execution via the registered OS protocol handler, if any. SECURITY WARNING: YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION.

Trait Implementations§

Source§

impl Clone for _cef_resource_request_handler_t

Source§

fn clone(&self) -> _cef_resource_request_handler_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for _cef_resource_request_handler_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for _cef_resource_request_handler_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.