_cef_browser_process_handler_t

Struct _cef_browser_process_handler_t 

Source
#[repr(C)]
pub struct _cef_browser_process_handler_t { pub base: cef_base_ref_counted_t, pub on_register_custom_preferences: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t, type_: cef_preferences_type_t, registrar: *mut _cef_preference_registrar_t)>, pub on_context_initialized: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t)>, pub on_before_child_process_launch: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t, command_line: *mut _cef_command_line_t)>, pub on_already_running_app_relaunch: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t, command_line: *mut _cef_command_line_t, current_directory: *const cef_string_t) -> c_int>, pub on_schedule_message_pump_work: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t, delay_ms: i64)>, pub get_default_client: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t) -> *mut _cef_client_t>, pub get_default_request_context_handler: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t) -> *mut _cef_request_context_handler_t>, }
Expand description

Structure used to implement browser process callbacks. The functions of this structure will be called on the browser process main thread unless otherwise indicated.

NOTE: This struct is allocated client-side.

Fields§

§base: cef_base_ref_counted_t

Base structure.

§on_register_custom_preferences: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t, type_: cef_preferences_type_t, registrar: *mut _cef_preference_registrar_t)>

Provides an opportunity to register custom preferences prior to global and request context initialization.

If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be accessed via cef_preference_manager_t::GetGlobalPreferences after OnContextInitialized is called. Global preferences are registered a single time at application startup. See related cef_settings_t.cache_path configuration.

If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be accessed via the cef_request_context_t after cef_request_context_handler_t::OnRequestContextInitialized is called. Request context preferences are registered each time a new cef_request_context_t is created. It is intended but not required that all request contexts have the same registered preferences. See related cef_request_context_settings_t.cache_path configuration.

Do not keep a reference to the |registrar| object. This function is called on the browser process UI thread.

§on_context_initialized: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t)>

Called on the browser process UI thread immediately after the CEF context has been initialized.

§on_before_child_process_launch: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t, command_line: *mut _cef_command_line_t)>

Called before a child process is launched. Will be called on the browser process UI thread when launching a render process and on the browser process IO thread when launching a GPU process. Provides an opportunity to modify the child process command line. Do not keep a reference to |command_line| outside of this function.

§on_already_running_app_relaunch: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t, command_line: *mut _cef_command_line_t, current_directory: *const cef_string_t) -> c_int>

Implement this function to provide app-specific behavior when an already running app is relaunched with the same CefSettings.root_cache_path value. For example, activate an existing app window or create a new app window. |command_line| will be read-only. Do not keep a reference to |command_line| outside of this function. Return true (1) if the relaunch is handled or false (0) for default relaunch behavior. Default behavior will create a new default styled Chrome window.

To avoid cache corruption only a single app instance is allowed to run for a given CefSettings.root_cache_path value. On relaunch the app checks a process singleton lock and then forwards the new launch arguments to the already running app process before exiting early. Client apps should therefore check the cef_initialize() return value for early exit before proceeding.

This function will be called on the browser process UI thread.

§on_schedule_message_pump_work: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t, delay_ms: i64)>

Called from any thread when work has been scheduled for the browser process main (UI) thread. This callback is used in combination with cef_settings_t.external_message_pump and cef_do_message_loop_work() in cases where the CEF message loop must be integrated into an existing application message loop (see additional comments and warnings on CefDoMessageLoopWork). This callback should schedule a cef_do_message_loop_work() call to happen on the main (UI) thread. |delay_ms| is the requested delay in milliseconds. If |delay_ms| is <= 0 then the call should happen reasonably soon. If |delay_ms| is > 0 then the call should be scheduled to happen after the specified delay and any currently pending scheduled call should be cancelled.

§get_default_client: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t) -> *mut _cef_client_t>

Return the default client for use with a newly created browser window (cef_browser_t object). If null is returned the cef_browser_t will be unmanaged (no callbacks will be executed for that cef_browser_t) and application shutdown will be blocked until the browser window is closed manually. This function is currently only used with Chrome style when creating new browser windows via Chrome UI.

§get_default_request_context_handler: Option<unsafe extern "C" fn(self_: *mut _cef_browser_process_handler_t) -> *mut _cef_request_context_handler_t>

Return the default handler for use with a new user or incognito profile (cef_request_context_t object). If null is returned the cef_request_context_t will be unmanaged (no callbacks will be executed for that cef_request_context_t). This function is currently only used with Chrome style when creating new browser windows via Chrome UI.

Trait Implementations§

Source§

impl Clone for _cef_browser_process_handler_t

Source§

fn clone(&self) -> _cef_browser_process_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_browser_process_handler_t

Source§

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

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

impl Copy for _cef_browser_process_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.