_cef_request_handler_t

Struct _cef_request_handler_t 

Source
#[repr(C)]
pub struct _cef_request_handler_t { pub base: cef_base_ref_counted_t, pub on_before_browse: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, user_gesture: c_int, is_redirect: c_int) -> c_int>, pub on_open_urlfrom_tab: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, target_url: *const cef_string_t, target_disposition: cef_window_open_disposition_t, user_gesture: c_int) -> c_int>, pub get_resource_request_handler: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, is_navigation: c_int, is_download: c_int, request_initiator: *const cef_string_t, disable_default_handling: *mut c_int) -> *mut _cef_resource_request_handler_t>, pub get_auth_credentials: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, origin_url: *const cef_string_t, isProxy: c_int, host: *const cef_string_t, port: c_int, realm: *const cef_string_t, scheme: *const cef_string_t, callback: *mut _cef_auth_callback_t) -> c_int>, pub on_certificate_error: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, cert_error: cef_errorcode_t, request_url: *const cef_string_t, ssl_info: *mut _cef_sslinfo_t, callback: *mut _cef_callback_t) -> c_int>, pub on_select_client_certificate: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, isProxy: c_int, host: *const cef_string_t, port: c_int, certificatesCount: usize, certificates: *const *mut _cef_x509_certificate_t, callback: *mut _cef_select_client_certificate_callback_t) -> c_int>, pub on_render_view_ready: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t)>, pub on_render_process_unresponsive: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, callback: *mut _cef_unresponsive_process_callback_t) -> c_int>, pub on_render_process_responsive: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t)>, pub on_render_process_terminated: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, status: cef_termination_status_t, error_code: c_int, error_string: *const cef_string_t)>, pub on_document_available_in_main_frame: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t)>, }
Expand description

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

NOTE: This struct is allocated client-side.

Fields§

§base: cef_base_ref_counted_t

Base structure.

§on_before_browse: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, user_gesture: c_int, is_redirect: c_int) -> c_int>

Called on the UI thread before browser navigation. Return true (1) to cancel the navigation or false (0) to allow the navigation to proceed. The |request| object cannot be modified in this callback. cef_load_handler_t::OnLoadingStateChange will be called twice in all cases. If the navigation is allowed cef_load_handler_t::OnLoadStart and cef_load_handler_t::OnLoadEnd will be called. If the navigation is canceled cef_load_handler_t::OnLoadError will be called with an |errorCode| value of ERR_ABORTED. The |user_gesture| value will be true (1) if the browser navigated via explicit user gesture (e.g. clicking a link) or false (0) if it navigated automatically (e.g. via the DomContentLoaded event).

§on_open_urlfrom_tab: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, target_url: *const cef_string_t, target_disposition: cef_window_open_disposition_t, user_gesture: c_int) -> c_int>

Called on the UI thread before OnBeforeBrowse in certain limited cases where navigating a new or different browser might be desirable. This includes user-initiated navigation that might open in a special way (e.g. links clicked via middle-click or ctrl + left-click) and certain types of cross-origin navigation initiated from the renderer process (e.g. navigating the top-level frame to/from a file URL). The |browser| and |frame| values represent the source of the navigation. The |target_disposition| value indicates where the user intended to navigate the browser based on standard Chromium behaviors (e.g. current tab, new tab, etc). The |user_gesture| value will be true (1) if the browser navigated via explicit user gesture (e.g. clicking a link) or false (0) if it navigated automatically (e.g. via the DomContentLoaded event). Return true (1) to cancel the navigation or false (0) to allow the navigation to proceed in the source browser’s top-level frame.

§get_resource_request_handler: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, request: *mut _cef_request_t, is_navigation: c_int, is_download: c_int, request_initiator: *const cef_string_t, disable_default_handling: *mut c_int) -> *mut _cef_resource_request_handler_t>

Called on the browser process IO thread before a resource request is initiated. The |browser| and |frame| values represent the source of the request. |request| represents the request contents and cannot be modified in this callback. |is_navigation| will be true (1) if the resource request is a navigation. |is_download| will be true (1) if the resource request is a download. |request_initiator| is the origin (scheme + domain) of the page that initiated the request. Set |disable_default_handling| to true (1) to disable default handling of the request, in which case it will need to be handled via cef_resource_request_handler_t::GetResourceHandler or it will be canceled. To allow the resource load to proceed with default handling return NULL. To specify a handler for the resource return a cef_resource_request_handler_t object. If this callback returns NULL the same function will be called on the associated cef_request_context_handler_t, if any.

§get_auth_credentials: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, origin_url: *const cef_string_t, isProxy: c_int, host: *const cef_string_t, port: c_int, realm: *const cef_string_t, scheme: *const cef_string_t, callback: *mut _cef_auth_callback_t) -> c_int>

Called on the IO thread when the browser needs credentials from the user. |origin_url| is the origin making this authentication request. |isProxy| indicates whether the host is a proxy server. |host| contains the hostname and |port| contains the port number. |realm| is the realm of the challenge and may be NULL. |scheme| is the authentication scheme used, such as “basic” or “digest”, and will be NULL if the source of the request is an FTP server. Return true (1) to continue the request and call cef_auth_callback_t::cont() either in this function or at a later time when the authentication information is available. Return false (0) to cancel the request immediately.

§on_certificate_error: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, cert_error: cef_errorcode_t, request_url: *const cef_string_t, ssl_info: *mut _cef_sslinfo_t, callback: *mut _cef_callback_t) -> c_int>

Called on the UI thread to handle requests for URLs with an invalid SSL certificate. Return true (1) and call cef_callback_t functions either in this function or at a later time to continue or cancel the request. Return false (0) to cancel the request immediately. If cef_settings_t.ignore_certificate_errors is set all invalid certificates will be accepted without calling this function.

§on_select_client_certificate: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, isProxy: c_int, host: *const cef_string_t, port: c_int, certificatesCount: usize, certificates: *const *mut _cef_x509_certificate_t, callback: *mut _cef_select_client_certificate_callback_t) -> c_int>

Called on the UI thread when a client certificate is being requested for authentication. Return false (0) to use the default behavior. If the |certificates| list is not NULL the default behavior will be to display a dialog for certificate selection. If the |certificates| list is NULL then the default behavior will be not to show a dialog and it will continue without using any certificate. Return true (1) and call cef_select_client_certificate_callback_t::Select either in this function or at a later time to select a certificate. Do not call Select or call it with NULL to continue without using any certificate. |isProxy| indicates whether the host is an HTTPS proxy or the origin server. |host| and |port| contains the hostname and port of the SSL server. |certificates| is the list of certificates to choose from; this list has already been pruned by Chromium so that it only contains certificates from issuers that the server trusts.

§on_render_view_ready: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t)>

Called on the browser process UI thread when the render view associated with |browser| is ready to receive/handle IPC messages in the render process.

§on_render_process_unresponsive: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, callback: *mut _cef_unresponsive_process_callback_t) -> c_int>

Called on the browser process UI thread when the render process is unresponsive as indicated by a lack of input event processing for at least 15 seconds. Return false (0) for the default behavior which is to continue waiting with Alloy style or display of the “Page unresponsive” dialog with Chrome style. Return true (1) and don’t execute the callback to continue waiting without display of the Chrome style dialog. Return true (1) and call cef_unresponsive_process_callback_t::Wait either in this function or at a later time to reset the wait timer. In cases where you continue waiting there may be another call to this function if the process remains unresponsive. Return true (1) and call cef_unresponsive_process_callback_t::Terminate either in this function or at a later time to terminate the unresponsive process, resulting in a call to OnRenderProcessTerminated. OnRenderProcessResponsive will be called if the process becomes responsive after this function is called. This functionality depends on the hang monitor which can be disabled by passing the --disable-hang-monitor command-line flag.

§on_render_process_responsive: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t)>

Called on the browser process UI thread when the render process becomes responsive after previously being unresponsive. See documentation on OnRenderProcessUnresponsive.

§on_render_process_terminated: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t, status: cef_termination_status_t, error_code: c_int, error_string: *const cef_string_t)>

Called on the browser process UI thread when the render process terminates unexpectedly. |status| indicates how the process terminated. |error_code| and |error_string| represent the error that would be displayed in Chrome’s “Aw, Snap!” view. Possible |error_code| values include cef_resultcode_t non-normal exit values and platform-specific crash values (for example, a Posix signal or Windows hardware exception).

§on_document_available_in_main_frame: Option<unsafe extern "C" fn(self_: *mut _cef_request_handler_t, browser: *mut _cef_browser_t)>

Called on the browser process UI thread when the window.document object of the main frame has been created.

Trait Implementations§

Source§

impl Clone for _cef_request_handler_t

Source§

fn clone(&self) -> _cef_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_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_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.