Add back API hashes

This commit is contained in:
Patrick Walton 2014-11-25 17:07:59 -08:00
parent e4362dad73
commit 14ef53cf57
2 changed files with 19 additions and 24 deletions

View file

@ -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
}
}

View file

@ -1107,13 +1107,6 @@ pub struct _cef_browser_host_t {
pub drag_source_system_drag_ended: Option<extern "C" fn(
this: *mut cef_browser_host_t) -> ()>,
//
// 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<extern "C" fn(this: *mut cef_browser_host_t) -> ()>,
//
// 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