diff --git a/ports/cef/core.rs b/ports/cef/core.rs index c5bbe52f3c8..a3e6b90dd9a 100644 --- a/ports/cef/core.rs +++ b/ports/cef/core.rs @@ -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 +} + diff --git a/ports/cef/eutil.rs b/ports/cef/eutil.rs index bde30231fcd..0821bb9d6c6 100644 --- a/ports/cef/eutil.rs +++ b/ports/cef/eutil.rs @@ -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. /// 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. -pub unsafe fn create_cef_object() -> *mut Base { - let size = (mem::size_of::() as size_t) + (mem::size_of::() as size_t) - 1; - println!("allocating CEF object with size {}", size); - let object = libc::calloc(1, size) as *mut cef_base_t; - (*object).size = size - mem::size_of::() as u64; // Subtract out the refcount. +pub unsafe fn create_cef_object(size: size_t) -> *mut Base { + let object = libc::calloc(1, (mem::size_of::() + mem::size_of::()) as u64) as + *mut cef_base_t; + (*object).size = size; (*object).add_ref = Some(servo_add_ref); (*object).release = Some(servo_release); *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) { - println!("freeing Servo-created CEF object!"); libc::free(object as *mut c_void); } diff --git a/ports/cef/interfaces/cef_app.rs b/ports/cef/interfaces/cef_app.rs index d3ddfa1673d..b47864fa63c 100644 --- a/ports/cef/interfaces/cef_app.rs +++ b/ports/cef/interfaces/cef_app.rs @@ -106,7 +106,7 @@ pub struct _cef_app_t { // // 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! diff --git a/ports/cef/interfaces/cef_auth_callback.rs b/ports/cef/interfaces/cef_auth_callback.rs index 8f24912c477..04a85d76442 100644 --- a/ports/cef/interfaces/cef_auth_callback.rs +++ b/ports/cef/interfaces/cef_auth_callback.rs @@ -71,7 +71,7 @@ pub struct _cef_auth_callback_t { // // 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! diff --git a/ports/cef/interfaces/cef_browser.rs b/ports/cef/interfaces/cef_browser.rs index c8e42570375..47c49466e2a 100644 --- a/ports/cef/interfaces/cef_browser.rs +++ b/ports/cef/interfaces/cef_browser.rs @@ -186,7 +186,7 @@ pub struct _cef_browser_t { // // 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! @@ -623,7 +623,7 @@ pub struct _cef_run_file_dialog_callback_t { // // 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! @@ -1118,7 +1118,7 @@ pub struct _cef_browser_host_t { // // 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! diff --git a/ports/cef/interfaces/cef_browser_process_handler.rs b/ports/cef/interfaces/cef_browser_process_handler.rs index 71acc80ae8b..5a03a2ac882 100644 --- a/ports/cef/interfaces/cef_browser_process_handler.rs +++ b/ports/cef/interfaces/cef_browser_process_handler.rs @@ -96,7 +96,7 @@ pub struct _cef_browser_process_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_callback.rs b/ports/cef/interfaces/cef_callback.rs index d90d58095e9..58e6e8d1ee3 100644 --- a/ports/cef/interfaces/cef_callback.rs +++ b/ports/cef/interfaces/cef_callback.rs @@ -68,7 +68,7 @@ pub struct _cef_callback_t { // // 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! @@ -218,7 +218,7 @@ pub struct _cef_completion_callback_t { // // 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! diff --git a/ports/cef/interfaces/cef_client.rs b/ports/cef/interfaces/cef_client.rs index 66a5e1ee34b..11d534133ee 100644 --- a/ports/cef/interfaces/cef_client.rs +++ b/ports/cef/interfaces/cef_client.rs @@ -151,7 +151,7 @@ pub struct _cef_client_t { // // 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! diff --git a/ports/cef/interfaces/cef_command_line.rs b/ports/cef/interfaces/cef_command_line.rs index ad23eb599b5..0f5acc73061 100644 --- a/ports/cef/interfaces/cef_command_line.rs +++ b/ports/cef/interfaces/cef_command_line.rs @@ -200,7 +200,7 @@ pub struct _cef_command_line_t { // // 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! diff --git a/ports/cef/interfaces/cef_context_menu_handler.rs b/ports/cef/interfaces/cef_context_menu_handler.rs index 3017851eb1c..8dac9e5ebf8 100644 --- a/ports/cef/interfaces/cef_context_menu_handler.rs +++ b/ports/cef/interfaces/cef_context_menu_handler.rs @@ -99,7 +99,7 @@ pub struct _cef_context_menu_handler_t { // // 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! @@ -426,7 +426,7 @@ pub struct _cef_context_menu_params_t { // // 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! diff --git a/ports/cef/interfaces/cef_cookie.rs b/ports/cef/interfaces/cef_cookie.rs index a6bb4995c27..de4770490d1 100644 --- a/ports/cef/interfaces/cef_cookie.rs +++ b/ports/cef/interfaces/cef_cookie.rs @@ -132,7 +132,7 @@ pub struct _cef_cookie_manager_t { // // 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! @@ -433,7 +433,7 @@ pub struct _cef_cookie_visitor_t { // // 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! diff --git a/ports/cef/interfaces/cef_dialog_handler.rs b/ports/cef/interfaces/cef_dialog_handler.rs index 88d0ec94210..98e1f6e9d6e 100644 --- a/ports/cef/interfaces/cef_dialog_handler.rs +++ b/ports/cef/interfaces/cef_dialog_handler.rs @@ -72,7 +72,7 @@ pub struct _cef_file_dialog_callback_t { // // 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! @@ -238,7 +238,7 @@ pub struct _cef_dialog_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_display_handler.rs b/ports/cef/interfaces/cef_display_handler.rs index 9fbadebaba8..664c2bf8891 100644 --- a/ports/cef/interfaces/cef_display_handler.rs +++ b/ports/cef/interfaces/cef_display_handler.rs @@ -103,7 +103,7 @@ pub struct _cef_display_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_dom.rs b/ports/cef/interfaces/cef_dom.rs index 185c166fabc..bd226731ce9 100644 --- a/ports/cef/interfaces/cef_dom.rs +++ b/ports/cef/interfaces/cef_dom.rs @@ -69,7 +69,7 @@ pub struct _cef_domvisitor_t { // // 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! @@ -308,7 +308,7 @@ pub struct _cef_domdocument_t { // // 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! @@ -820,7 +820,7 @@ pub struct _cef_domnode_t { // // 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! diff --git a/ports/cef/interfaces/cef_download_handler.rs b/ports/cef/interfaces/cef_download_handler.rs index 1648129aa7a..c6538434063 100644 --- a/ports/cef/interfaces/cef_download_handler.rs +++ b/ports/cef/interfaces/cef_download_handler.rs @@ -68,7 +68,7 @@ pub struct _cef_before_download_callback_t { // // 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! @@ -209,7 +209,7 @@ pub struct _cef_download_item_callback_t { // // 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! @@ -367,7 +367,7 @@ pub struct _cef_download_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_download_item.rs b/ports/cef/interfaces/cef_download_item.rs index c8e893cf73e..2acda63dcd4 100644 --- a/ports/cef/interfaces/cef_download_item.rs +++ b/ports/cef/interfaces/cef_download_item.rs @@ -160,7 +160,7 @@ pub struct _cef_download_item_t { // // 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! diff --git a/ports/cef/interfaces/cef_drag_data.rs b/ports/cef/interfaces/cef_drag_data.rs index 02c11f12431..385210f5d53 100644 --- a/ports/cef/interfaces/cef_drag_data.rs +++ b/ports/cef/interfaces/cef_drag_data.rs @@ -204,7 +204,7 @@ pub struct _cef_drag_data_t { // // 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! diff --git a/ports/cef/interfaces/cef_drag_handler.rs b/ports/cef/interfaces/cef_drag_handler.rs index cd50c65b119..fbcd50089ad 100644 --- a/ports/cef/interfaces/cef_drag_handler.rs +++ b/ports/cef/interfaces/cef_drag_handler.rs @@ -70,7 +70,7 @@ pub struct _cef_drag_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_focus_handler.rs b/ports/cef/interfaces/cef_focus_handler.rs index 37f63af58e3..f5114646b14 100644 --- a/ports/cef/interfaces/cef_focus_handler.rs +++ b/ports/cef/interfaces/cef_focus_handler.rs @@ -83,7 +83,7 @@ pub struct _cef_focus_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_frame.rs b/ports/cef/interfaces/cef_frame.rs index 2611cd62dee..2de1a1af466 100644 --- a/ports/cef/interfaces/cef_frame.rs +++ b/ports/cef/interfaces/cef_frame.rs @@ -214,7 +214,7 @@ pub struct _cef_frame_t { // // 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! diff --git a/ports/cef/interfaces/cef_geolocation.rs b/ports/cef/interfaces/cef_geolocation.rs index 0872cf91b35..8c044f5e04d 100644 --- a/ports/cef/interfaces/cef_geolocation.rs +++ b/ports/cef/interfaces/cef_geolocation.rs @@ -67,7 +67,7 @@ pub struct _cef_get_geolocation_callback_t { // // 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! diff --git a/ports/cef/interfaces/cef_geolocation_handler.rs b/ports/cef/interfaces/cef_geolocation_handler.rs index d626419062b..18c93ed895a 100644 --- a/ports/cef/interfaces/cef_geolocation_handler.rs +++ b/ports/cef/interfaces/cef_geolocation_handler.rs @@ -65,7 +65,7 @@ pub struct _cef_geolocation_callback_t { // // 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! @@ -224,7 +224,7 @@ pub struct _cef_geolocation_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_jsdialog_handler.rs b/ports/cef/interfaces/cef_jsdialog_handler.rs index 8e399a1e1b5..be9d47fa1ba 100644 --- a/ports/cef/interfaces/cef_jsdialog_handler.rs +++ b/ports/cef/interfaces/cef_jsdialog_handler.rs @@ -66,7 +66,7 @@ pub struct _cef_jsdialog_callback_t { // // 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! @@ -255,7 +255,7 @@ pub struct _cef_jsdialog_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_keyboard_handler.rs b/ports/cef/interfaces/cef_keyboard_handler.rs index 78be704e22b..0061984ced1 100644 --- a/ports/cef/interfaces/cef_keyboard_handler.rs +++ b/ports/cef/interfaces/cef_keyboard_handler.rs @@ -81,7 +81,7 @@ pub struct _cef_keyboard_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_life_span_handler.rs b/ports/cef/interfaces/cef_life_span_handler.rs index b296bfe42fd..d218c4bbf15 100644 --- a/ports/cef/interfaces/cef_life_span_handler.rs +++ b/ports/cef/interfaces/cef_life_span_handler.rs @@ -168,7 +168,7 @@ pub struct _cef_life_span_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_load_handler.rs b/ports/cef/interfaces/cef_load_handler.rs index 831f617f533..d46e515c3ef 100644 --- a/ports/cef/interfaces/cef_load_handler.rs +++ b/ports/cef/interfaces/cef_load_handler.rs @@ -108,7 +108,7 @@ pub struct _cef_load_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_menu_model.rs b/ports/cef/interfaces/cef_menu_model.rs index c1972ddc8cc..b1757917f47 100644 --- a/ports/cef/interfaces/cef_menu_model.rs +++ b/ports/cef/interfaces/cef_menu_model.rs @@ -401,7 +401,7 @@ pub struct _cef_menu_model_t { // // 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! diff --git a/ports/cef/interfaces/cef_print_handler.rs b/ports/cef/interfaces/cef_print_handler.rs index 7d4ceb16025..b8f36809dc0 100644 --- a/ports/cef/interfaces/cef_print_handler.rs +++ b/ports/cef/interfaces/cef_print_handler.rs @@ -70,7 +70,7 @@ pub struct _cef_print_dialog_callback_t { // // 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! @@ -220,7 +220,7 @@ pub struct _cef_print_job_callback_t { // // 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! @@ -385,7 +385,7 @@ pub struct _cef_print_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_print_settings.rs b/ports/cef/interfaces/cef_print_settings.rs index 86528c88b76..cd28e8d7784 100644 --- a/ports/cef/interfaces/cef_print_settings.rs +++ b/ports/cef/interfaces/cef_print_settings.rs @@ -206,7 +206,7 @@ pub struct _cef_print_settings_t { // // 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! diff --git a/ports/cef/interfaces/cef_process_message.rs b/ports/cef/interfaces/cef_process_message.rs index b2fcf4c784b..da56b1f3bba 100644 --- a/ports/cef/interfaces/cef_process_message.rs +++ b/ports/cef/interfaces/cef_process_message.rs @@ -91,7 +91,7 @@ pub struct _cef_process_message_t { // // 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! diff --git a/ports/cef/interfaces/cef_render_handler.rs b/ports/cef/interfaces/cef_render_handler.rs index 0ab5bf7e6e5..bae32a055b3 100644 --- a/ports/cef/interfaces/cef_render_handler.rs +++ b/ports/cef/interfaces/cef_render_handler.rs @@ -184,7 +184,7 @@ pub struct _cef_render_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_render_process_handler.rs b/ports/cef/interfaces/cef_render_process_handler.rs index a9a8f92352a..869082f8db4 100644 --- a/ports/cef/interfaces/cef_render_process_handler.rs +++ b/ports/cef/interfaces/cef_render_process_handler.rs @@ -173,7 +173,7 @@ pub struct _cef_render_process_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_request.rs b/ports/cef/interfaces/cef_request.rs index 5d6fa8fc3d4..07a534e5e4c 100644 --- a/ports/cef/interfaces/cef_request.rs +++ b/ports/cef/interfaces/cef_request.rs @@ -167,7 +167,7 @@ pub struct _cef_request_t { // // 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! @@ -581,7 +581,7 @@ pub struct _cef_post_data_t { // // 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! @@ -853,7 +853,7 @@ pub struct _cef_post_data_element_t { // // 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! diff --git a/ports/cef/interfaces/cef_request_context.rs b/ports/cef/interfaces/cef_request_context.rs index 84a10d44c3f..0c55410507c 100644 --- a/ports/cef/interfaces/cef_request_context.rs +++ b/ports/cef/interfaces/cef_request_context.rs @@ -89,7 +89,7 @@ pub struct _cef_request_context_t { // // 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! diff --git a/ports/cef/interfaces/cef_request_context_handler.rs b/ports/cef/interfaces/cef_request_context_handler.rs index 7a0425302c7..fc068697e0b 100644 --- a/ports/cef/interfaces/cef_request_context_handler.rs +++ b/ports/cef/interfaces/cef_request_context_handler.rs @@ -65,7 +65,7 @@ pub struct _cef_request_context_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_request_handler.rs b/ports/cef/interfaces/cef_request_handler.rs index e519cad7399..169f8c4a670 100644 --- a/ports/cef/interfaces/cef_request_handler.rs +++ b/ports/cef/interfaces/cef_request_handler.rs @@ -70,7 +70,7 @@ pub struct _cef_quota_callback_t { // // 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! @@ -225,7 +225,7 @@ pub struct _cef_allow_certificate_error_callback_t { // // 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! @@ -485,7 +485,7 @@ pub struct _cef_request_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_resource_bundle_handler.rs b/ports/cef/interfaces/cef_resource_bundle_handler.rs index 3551a0d06e1..4730a16981b 100644 --- a/ports/cef/interfaces/cef_resource_bundle_handler.rs +++ b/ports/cef/interfaces/cef_resource_bundle_handler.rs @@ -82,7 +82,7 @@ pub struct _cef_resource_bundle_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_resource_handler.rs b/ports/cef/interfaces/cef_resource_handler.rs index 63cc82fb070..715271adac6 100644 --- a/ports/cef/interfaces/cef_resource_handler.rs +++ b/ports/cef/interfaces/cef_resource_handler.rs @@ -117,7 +117,7 @@ pub struct _cef_resource_handler_t { // // 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! diff --git a/ports/cef/interfaces/cef_response.rs b/ports/cef/interfaces/cef_response.rs index 412472a44c3..791572bb1c6 100644 --- a/ports/cef/interfaces/cef_response.rs +++ b/ports/cef/interfaces/cef_response.rs @@ -122,7 +122,7 @@ pub struct _cef_response_t { // // 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! diff --git a/ports/cef/interfaces/cef_scheme.rs b/ports/cef/interfaces/cef_scheme.rs index 729ac8d53ee..62f71533ebc 100644 --- a/ports/cef/interfaces/cef_scheme.rs +++ b/ports/cef/interfaces/cef_scheme.rs @@ -108,7 +108,7 @@ pub struct _cef_scheme_registrar_t { // // 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! @@ -303,7 +303,7 @@ pub struct _cef_scheme_handler_factory_t { // // 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! diff --git a/ports/cef/interfaces/cef_stream.rs b/ports/cef/interfaces/cef_stream.rs index a4163db6c14..a1e748793d8 100644 --- a/ports/cef/interfaces/cef_stream.rs +++ b/ports/cef/interfaces/cef_stream.rs @@ -90,7 +90,7 @@ pub struct _cef_read_handler_t { // // 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! @@ -318,7 +318,7 @@ pub struct _cef_stream_reader_t { // // 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! @@ -583,7 +583,7 @@ pub struct _cef_write_handler_t { // // 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! @@ -812,7 +812,7 @@ pub struct _cef_stream_writer_t { // // 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! diff --git a/ports/cef/interfaces/cef_string_visitor.rs b/ports/cef/interfaces/cef_string_visitor.rs index 9c8492e84e2..cb589e7850a 100644 --- a/ports/cef/interfaces/cef_string_visitor.rs +++ b/ports/cef/interfaces/cef_string_visitor.rs @@ -64,7 +64,7 @@ pub struct _cef_string_visitor_t { // // 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! diff --git a/ports/cef/interfaces/cef_task.rs b/ports/cef/interfaces/cef_task.rs index 5f8aa5cb19e..19cf20a8633 100644 --- a/ports/cef/interfaces/cef_task.rs +++ b/ports/cef/interfaces/cef_task.rs @@ -68,7 +68,7 @@ pub struct _cef_task_t { // // 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! @@ -244,7 +244,7 @@ pub struct _cef_task_runner_t { // // 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! diff --git a/ports/cef/interfaces/cef_trace.rs b/ports/cef/interfaces/cef_trace.rs index 34644003f33..76000fc060a 100644 --- a/ports/cef/interfaces/cef_trace.rs +++ b/ports/cef/interfaces/cef_trace.rs @@ -69,7 +69,7 @@ pub struct _cef_end_tracing_callback_t { // // 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! diff --git a/ports/cef/interfaces/cef_urlrequest.rs b/ports/cef/interfaces/cef_urlrequest.rs index 123224e47c6..876bea28942 100644 --- a/ports/cef/interfaces/cef_urlrequest.rs +++ b/ports/cef/interfaces/cef_urlrequest.rs @@ -101,7 +101,7 @@ pub struct _cef_urlrequest_t { // // 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! @@ -387,7 +387,7 @@ pub struct _cef_urlrequest_client_t { // // 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! diff --git a/ports/cef/interfaces/cef_v8.rs b/ports/cef/interfaces/cef_v8.rs index 1418c48dba4..4a42ef8d36c 100644 --- a/ports/cef/interfaces/cef_v8.rs +++ b/ports/cef/interfaces/cef_v8.rs @@ -131,7 +131,7 @@ pub struct _cef_v8context_t { // // 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! @@ -447,7 +447,7 @@ pub struct _cef_v8handler_t { // // 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! @@ -619,7 +619,7 @@ pub struct _cef_v8accessor_t { // // 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! @@ -844,7 +844,7 @@ pub struct _cef_v8exception_t { // // 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! @@ -1416,7 +1416,7 @@ pub struct _cef_v8value_t { // // 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! @@ -2423,7 +2423,7 @@ pub struct _cef_v8stack_trace_t { // // 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! @@ -2660,7 +2660,7 @@ pub struct _cef_v8stack_frame_t { // // 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! diff --git a/ports/cef/interfaces/cef_values.rs b/ports/cef/interfaces/cef_values.rs index abea93e2e04..9eed34a61e2 100644 --- a/ports/cef/interfaces/cef_values.rs +++ b/ports/cef/interfaces/cef_values.rs @@ -91,7 +91,7 @@ pub struct _cef_binary_value_t { // // 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! @@ -476,7 +476,7 @@ pub struct _cef_dictionary_value_t { // // 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! @@ -1179,7 +1179,7 @@ pub struct _cef_list_value_t { // // 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! diff --git a/ports/cef/interfaces/cef_web_plugin.rs b/ports/cef/interfaces/cef_web_plugin.rs index 725c749560a..5f4943d6077 100644 --- a/ports/cef/interfaces/cef_web_plugin.rs +++ b/ports/cef/interfaces/cef_web_plugin.rs @@ -86,7 +86,7 @@ pub struct _cef_web_plugin_info_t { // // 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! @@ -273,7 +273,7 @@ pub struct _cef_web_plugin_info_visitor_t { // // 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! @@ -421,7 +421,7 @@ pub struct _cef_web_plugin_unstable_callback_t { // // 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! diff --git a/ports/cef/interfaces/cef_xml_reader.rs b/ports/cef/interfaces/cef_xml_reader.rs index 361339cd85e..eb453ce6ebe 100644 --- a/ports/cef/interfaces/cef_xml_reader.rs +++ b/ports/cef/interfaces/cef_xml_reader.rs @@ -277,7 +277,7 @@ pub struct _cef_xml_reader_t { // // 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! diff --git a/ports/cef/interfaces/cef_zip_reader.rs b/ports/cef/interfaces/cef_zip_reader.rs index efac8229cca..7f1c08e335f 100644 --- a/ports/cef/interfaces/cef_zip_reader.rs +++ b/ports/cef/interfaces/cef_zip_reader.rs @@ -140,7 +140,7 @@ pub struct _cef_zip_reader_t { // // 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! diff --git a/ports/cef/macros.rs b/ports/cef/macros.rs index 4debc353555..c02f936c2ee 100644 --- a/ports/cef/macros.rs +++ b/ports/cef/macros.rs @@ -43,8 +43,13 @@ macro_rules! cef_class_impl( impl $class_name { pub fn as_cef_interface(self) -> $interface_name { 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( - ::eutil::create_cef_object::<$c_interface_name,$class_name>()) + ::eutil::create_cef_object::<$c_interface_name,$class_name>(size)) }; unsafe { $((*cef_object.c_object()).$method_name = Some($method_name);)*