From 14ef53cf57addf85242e63e24433aeddf60a9793 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 25 Nov 2014 17:07:59 -0800 Subject: [PATCH] Add back API hashes --- ports/cef/core.rs | 20 +++++++++++++++++++- ports/cef/interfaces/cef_browser.rs | 23 ----------------------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/ports/cef/core.rs b/ports/cef/core.rs index bb0a92c071a..c5bbe52f3c8 100644 --- a/ports/cef/core.rs +++ b/ports/cef/core.rs @@ -11,11 +11,19 @@ use types::{cef_main_args_t, cef_settings_t}; use glfw_app; use libc::funcs::c95::string::strlen; -use libc::{c_int, c_void}; +use libc::{c_char, c_int, c_void}; use native; use servo::Browser; use std::slice; +static CEF_API_HASH_UNIVERSAL: &'static [u8] = b"8efd129f4afc344bd04b2feb7f73a149b6c4e27f\0"; +#[cfg(target_os="windows")] +static CEF_API_HASH_PLATFORM: &'static [u8] = b"5c7f3e50ff5265985d11dc1a466513e25748bedd\0"; +#[cfg(target_os="macos")] +static CEF_API_HASH_PLATFORM: &'static [u8] = b"6813214accbf2ebfb6bdcf8d00654650b251bf3d\0"; +#[cfg(target_os="linux")] +static CEF_API_HASH_PLATFORM: &'static [u8] = b"2bc564c3871965ef3a2531b528bda3e17fa17a6d\0"; + #[no_mangle] pub extern "C" fn cef_initialize(args: *const cef_main_args_t, _settings: *mut cef_settings_t, @@ -115,3 +123,13 @@ pub extern "C" fn cef_execute_process(args: *const cef_main_args_t, //process type not specified, must be browser process (NOOP) -1 } + +#[no_mangle] +pub extern "C" fn cef_api_hash(entry: c_int) -> *const c_char { + if entry == 0 { + &CEF_API_HASH_PLATFORM[0] as *const u8 as *const c_char + } else { + &CEF_API_HASH_UNIVERSAL[0] as *const u8 as *const c_char + } +} + diff --git a/ports/cef/interfaces/cef_browser.rs b/ports/cef/interfaces/cef_browser.rs index e2f18a76d73..3383033c3a6 100644 --- a/ports/cef/interfaces/cef_browser.rs +++ b/ports/cef/interfaces/cef_browser.rs @@ -1107,13 +1107,6 @@ pub struct _cef_browser_host_t { pub drag_source_system_drag_ended: Option ()>, - // - // Instructs the browser to perform an accelerated composite. The appropriate - // Direct3D or OpenGL state must have been set up before calling this - // function. - // - pub composite: Option ()>, - // // Instructs the browser to initialize accelerated compositing. The // appropriate Direct3D or OpenGL state must have been set up before calling @@ -1932,22 +1925,6 @@ impl CefBrowserHost { } } - // - // Instructs the browser to perform an accelerated composite. The appropriate - // Direct3D or OpenGL state must have been set up before calling this - // function. - // - pub fn composite(&self) -> () { - if self.c_object.is_null() { - panic!("called a CEF method on a null object") - } - unsafe { - CefWrap::to_rust( - ((*self.c_object).composite.unwrap())( - self.c_object)) - } - } - // // Instructs the browser to initialize accelerated compositing. The // appropriate Direct3D or OpenGL state must have been set up before calling