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

@ -106,8 +106,7 @@ pub struct CefFocusHandler {
impl Clone for CefFocusHandler {
fn clone(&self) -> CefFocusHandler{
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);
}
CefFocusHandler {
@ -120,8 +119,7 @@ impl Clone for CefFocusHandler {
impl Drop for CefFocusHandler {
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);
}
}
@ -136,8 +134,7 @@ impl CefFocusHandler {
}
pub unsafe fn from_c_object_addref(c_object: *mut cef_focus_handler_t) -> CefFocusHandler {
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);
}
CefFocusHandler {
@ -151,8 +148,7 @@ impl CefFocusHandler {
pub fn c_object_addrefed(&self) -> *mut cef_focus_handler_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
@ -160,10 +156,10 @@ impl CefFocusHandler {
}
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()
}
//
@ -174,8 +170,7 @@ impl CefFocusHandler {
//
pub fn on_take_focus(&self, browser: interfaces::CefBrowser,
next: libc::c_int) -> () {
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 {
@ -194,8 +189,7 @@ impl CefFocusHandler {
//
pub fn on_set_focus(&self, browser: interfaces::CefBrowser,
source: types::cef_focus_source_t) -> libc::c_int {
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 {
@ -211,8 +205,7 @@ impl CefFocusHandler {
// Called when the browser component has received focus.
//
pub fn on_got_focus(&self, browser: interfaces::CefBrowser) -> () {
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 {
@ -240,8 +233,7 @@ impl CefWrap<*mut cef_focus_handler_t> for Option<CefFocusHandler> {
}
}
unsafe fn to_rust(c_object: *mut cef_focus_handler_t) -> Option<CefFocusHandler> {
if c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
if c_object.is_null() {
None
} else {
Some(CefFocusHandler::from_c_object_addref(c_object))