mirror of
https://github.com/servo/servo.git
synced 2025-07-16 11:53:39 +01:00
add cef method for notifying the main loop of work available
This commit is contained in:
parent
d87af8ac52
commit
d7ad5d6ea2
1 changed files with 21 additions and 0 deletions
|
@ -94,6 +94,12 @@ pub struct _cef_browser_process_handler_t {
|
|||
pub get_print_handler: Option<extern "C" fn(
|
||||
this: *mut cef_browser_process_handler_t) -> *mut interfaces::cef_print_handler_t>,
|
||||
|
||||
//
|
||||
// Called when the application should call cef_do_message_loop_work()
|
||||
//
|
||||
pub on_work_available: Option<extern "C" fn(
|
||||
this: *mut cef_browser_process_handler_t) -> ()>,
|
||||
|
||||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
|
@ -253,6 +259,21 @@ impl CefBrowserProcessHandler {
|
|||
self.c_object))
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Called when the application should call cef_do_message_loop_work()
|
||||
//
|
||||
pub fn on_work_available(&self) -> () {
|
||||
if self.c_object.is_null() ||
|
||||
self.c_object as usize == mem::POST_DROP_USIZE {
|
||||
panic!("called a CEF method on a null object")
|
||||
}
|
||||
unsafe {
|
||||
CefWrap::to_rust(
|
||||
((*self.c_object).on_work_available.unwrap())(
|
||||
self.c_object))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl CefWrap<*mut cef_browser_process_handler_t> for CefBrowserProcessHandler {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue