Update Rust to 1.13.0-nightly (198713106 2016-08-26)

This commit is contained in:
Anthony Ramine 2016-08-26 16:49:47 +02:00
parent f4d3281a6a
commit c66380d83c
64 changed files with 1428 additions and 2636 deletions

View file

@ -129,8 +129,7 @@ pub struct CefApp {
impl Clone for CefApp {
fn clone(&self) -> CefApp{
unsafe {
if !self.c_object.is_null() &&
self.c_object as usize != mem::POST_DROP_USIZE {
if !self.c_object.is_null() {
((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
}
CefApp {
@ -143,8 +142,7 @@ impl Clone for CefApp {
impl Drop for CefApp {
fn drop(&mut self) {
unsafe {
if !self.c_object.is_null() &&
self.c_object as usize != mem::POST_DROP_USIZE {
if !self.c_object.is_null() {
((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
}
}
@ -159,8 +157,7 @@ impl CefApp {
}
pub unsafe fn from_c_object_addref(c_object: *mut cef_app_t) -> CefApp {
if !c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
if !c_object.is_null() {
((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
}
CefApp {
@ -174,8 +171,7 @@ impl CefApp {
pub fn c_object_addrefed(&self) -> *mut cef_app_t {
unsafe {
if !self.c_object.is_null() &&
self.c_object as usize != mem::POST_DROP_USIZE {
if !self.c_object.is_null() {
eutil::add_ref(self.c_object as *mut types::cef_base_t);
}
self.c_object
@ -183,10 +179,10 @@ impl CefApp {
}
pub fn is_null_cef_object(&self) -> bool {
self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
self.c_object.is_null()
}
pub fn is_not_null_cef_object(&self) -> bool {
!self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
!self.c_object.is_null()
}
//
@ -202,8 +198,7 @@ impl CefApp {
//
pub fn on_before_command_line_processing(&self, process_type: &[u16],
command_line: interfaces::CefCommandLine) -> () {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -223,8 +218,7 @@ impl CefApp {
//
pub fn on_register_custom_schemes(&self,
registrar: interfaces::CefSchemeRegistrar) -> () {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -243,8 +237,7 @@ impl CefApp {
//
pub fn get_resource_bundle_handler(
&self) -> interfaces::CefResourceBundleHandler {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -260,8 +253,7 @@ impl CefApp {
//
pub fn get_browser_process_handler(
&self) -> interfaces::CefBrowserProcessHandler {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -277,8 +269,7 @@ impl CefApp {
//
pub fn get_render_process_handler(
&self) -> interfaces::CefRenderProcessHandler {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -305,8 +296,7 @@ impl CefWrap<*mut cef_app_t> for Option<CefApp> {
}
}
unsafe fn to_rust(c_object: *mut cef_app_t) -> Option<CefApp> {
if c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
if c_object.is_null() {
None
} else {
Some(CefApp::from_c_object_addref(c_object))