mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update to get the reference counting correct
This commit is contained in:
parent
1ac5bfe830
commit
c52f550367
51 changed files with 97 additions and 89 deletions
|
@ -133,3 +133,8 @@ pub extern "C" fn cef_api_hash(entry: c_int) -> *const c_char {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn cef_get_min_log_level() -> c_int {
|
||||||
|
0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,11 +30,10 @@ pub fn slice_to_str(s: *const u8, l: uint, f: |&str| -> c_int) -> c_int {
|
||||||
/// Creates a new raw CEF object of the given type and sets up its reference counting machinery.
|
/// Creates a new raw CEF object of the given type and sets up its reference counting machinery.
|
||||||
/// All fields are initialized to zero. It is the caller's responsibility to ensure that the given
|
/// All fields are initialized to zero. It is the caller's responsibility to ensure that the given
|
||||||
/// type is a CEF type with `cef_base_t` as its first member.
|
/// type is a CEF type with `cef_base_t` as its first member.
|
||||||
pub unsafe fn create_cef_object<Base,Extra>() -> *mut Base {
|
pub unsafe fn create_cef_object<Base,Extra>(size: size_t) -> *mut Base {
|
||||||
let size = (mem::size_of::<Base>() as size_t) + (mem::size_of::<Extra>() as size_t) - 1;
|
let object = libc::calloc(1, (mem::size_of::<Base>() + mem::size_of::<Extra>()) as u64) as
|
||||||
println!("allocating CEF object with size {}", size);
|
*mut cef_base_t;
|
||||||
let object = libc::calloc(1, size) as *mut cef_base_t;
|
(*object).size = size;
|
||||||
(*object).size = size - mem::size_of::<uint>() as u64; // Subtract out the refcount.
|
|
||||||
(*object).add_ref = Some(servo_add_ref);
|
(*object).add_ref = Some(servo_add_ref);
|
||||||
(*object).release = Some(servo_release);
|
(*object).release = Some(servo_release);
|
||||||
*ref_count(object) = 1;
|
*ref_count(object) = 1;
|
||||||
|
@ -72,7 +71,6 @@ extern "C" fn servo_release(object: *mut cef_base_t) -> c_int {
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn servo_free(object: *mut cef_base_t) {
|
unsafe fn servo_free(object: *mut cef_base_t) {
|
||||||
println!("freeing Servo-created CEF object!");
|
|
||||||
libc::free(object as *mut c_void);
|
libc::free(object as *mut c_void);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ pub struct _cef_app_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -71,7 +71,7 @@ pub struct _cef_auth_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -186,7 +186,7 @@ pub struct _cef_browser_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -623,7 +623,7 @@ pub struct _cef_run_file_dialog_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -1118,7 +1118,7 @@ pub struct _cef_browser_host_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -96,7 +96,7 @@ pub struct _cef_browser_process_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -68,7 +68,7 @@ pub struct _cef_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -218,7 +218,7 @@ pub struct _cef_completion_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -151,7 +151,7 @@ pub struct _cef_client_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -200,7 +200,7 @@ pub struct _cef_command_line_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -99,7 +99,7 @@ pub struct _cef_context_menu_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -426,7 +426,7 @@ pub struct _cef_context_menu_params_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -132,7 +132,7 @@ pub struct _cef_cookie_manager_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -433,7 +433,7 @@ pub struct _cef_cookie_visitor_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -72,7 +72,7 @@ pub struct _cef_file_dialog_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -238,7 +238,7 @@ pub struct _cef_dialog_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -103,7 +103,7 @@ pub struct _cef_display_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -69,7 +69,7 @@ pub struct _cef_domvisitor_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -308,7 +308,7 @@ pub struct _cef_domdocument_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -820,7 +820,7 @@ pub struct _cef_domnode_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -68,7 +68,7 @@ pub struct _cef_before_download_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -209,7 +209,7 @@ pub struct _cef_download_item_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -367,7 +367,7 @@ pub struct _cef_download_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -160,7 +160,7 @@ pub struct _cef_download_item_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -204,7 +204,7 @@ pub struct _cef_drag_data_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -70,7 +70,7 @@ pub struct _cef_drag_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -83,7 +83,7 @@ pub struct _cef_focus_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -214,7 +214,7 @@ pub struct _cef_frame_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -67,7 +67,7 @@ pub struct _cef_get_geolocation_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -65,7 +65,7 @@ pub struct _cef_geolocation_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -224,7 +224,7 @@ pub struct _cef_geolocation_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -66,7 +66,7 @@ pub struct _cef_jsdialog_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -255,7 +255,7 @@ pub struct _cef_jsdialog_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -81,7 +81,7 @@ pub struct _cef_keyboard_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -168,7 +168,7 @@ pub struct _cef_life_span_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -108,7 +108,7 @@ pub struct _cef_load_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -401,7 +401,7 @@ pub struct _cef_menu_model_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -70,7 +70,7 @@ pub struct _cef_print_dialog_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -220,7 +220,7 @@ pub struct _cef_print_job_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -385,7 +385,7 @@ pub struct _cef_print_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -206,7 +206,7 @@ pub struct _cef_print_settings_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -91,7 +91,7 @@ pub struct _cef_process_message_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -184,7 +184,7 @@ pub struct _cef_render_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -173,7 +173,7 @@ pub struct _cef_render_process_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -167,7 +167,7 @@ pub struct _cef_request_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -581,7 +581,7 @@ pub struct _cef_post_data_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -853,7 +853,7 @@ pub struct _cef_post_data_element_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -89,7 +89,7 @@ pub struct _cef_request_context_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -65,7 +65,7 @@ pub struct _cef_request_context_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -70,7 +70,7 @@ pub struct _cef_quota_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -225,7 +225,7 @@ pub struct _cef_allow_certificate_error_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -485,7 +485,7 @@ pub struct _cef_request_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -82,7 +82,7 @@ pub struct _cef_resource_bundle_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -117,7 +117,7 @@ pub struct _cef_resource_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -122,7 +122,7 @@ pub struct _cef_response_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -108,7 +108,7 @@ pub struct _cef_scheme_registrar_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -303,7 +303,7 @@ pub struct _cef_scheme_handler_factory_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -90,7 +90,7 @@ pub struct _cef_read_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -318,7 +318,7 @@ pub struct _cef_stream_reader_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -583,7 +583,7 @@ pub struct _cef_write_handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -812,7 +812,7 @@ pub struct _cef_stream_writer_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -64,7 +64,7 @@ pub struct _cef_string_visitor_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -68,7 +68,7 @@ pub struct _cef_task_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -244,7 +244,7 @@ pub struct _cef_task_runner_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -69,7 +69,7 @@ pub struct _cef_end_tracing_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -101,7 +101,7 @@ pub struct _cef_urlrequest_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -387,7 +387,7 @@ pub struct _cef_urlrequest_client_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -131,7 +131,7 @@ pub struct _cef_v8context_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -447,7 +447,7 @@ pub struct _cef_v8handler_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -619,7 +619,7 @@ pub struct _cef_v8accessor_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -844,7 +844,7 @@ pub struct _cef_v8exception_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -1416,7 +1416,7 @@ pub struct _cef_v8value_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -2423,7 +2423,7 @@ pub struct _cef_v8stack_trace_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -2660,7 +2660,7 @@ pub struct _cef_v8stack_frame_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -91,7 +91,7 @@ pub struct _cef_binary_value_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -476,7 +476,7 @@ pub struct _cef_dictionary_value_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -1179,7 +1179,7 @@ pub struct _cef_list_value_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -86,7 +86,7 @@ pub struct _cef_web_plugin_info_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -273,7 +273,7 @@ pub struct _cef_web_plugin_info_visitor_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
@ -421,7 +421,7 @@ pub struct _cef_web_plugin_unstable_callback_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -277,7 +277,7 @@ pub struct _cef_xml_reader_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -140,7 +140,7 @@ pub struct _cef_zip_reader_t {
|
||||||
//
|
//
|
||||||
// The reference count. This will only be present for Rust instances!
|
// The reference count. This will only be present for Rust instances!
|
||||||
//
|
//
|
||||||
ref_count: uint,
|
pub ref_count: uint,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra data. This will only be present for Rust instances!
|
// Extra data. This will only be present for Rust instances!
|
||||||
|
|
|
@ -43,8 +43,13 @@ macro_rules! cef_class_impl(
|
||||||
impl $class_name {
|
impl $class_name {
|
||||||
pub fn as_cef_interface(self) -> $interface_name {
|
pub fn as_cef_interface(self) -> $interface_name {
|
||||||
let cef_object = unsafe {
|
let cef_object = unsafe {
|
||||||
|
// Calculate the offset of the reference count. This is the size of the
|
||||||
|
// structure.
|
||||||
|
let null: *const $c_interface_name = ::std::ptr::null();
|
||||||
|
let offset: *const uint = &(*null).ref_count;
|
||||||
|
let size = (offset as ::libc::size_t) - (null as ::libc::size_t);
|
||||||
$interface_name::from_c_object_addref(
|
$interface_name::from_c_object_addref(
|
||||||
::eutil::create_cef_object::<$c_interface_name,$class_name>())
|
::eutil::create_cef_object::<$c_interface_name,$class_name>(size))
|
||||||
};
|
};
|
||||||
unsafe {
|
unsafe {
|
||||||
$((*cef_object.c_object()).$method_name = Some($method_name);)*
|
$((*cef_object.c_object()).$method_name = Some($method_name);)*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue