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

@ -105,8 +105,7 @@ pub struct CefDragHandler {
impl Clone for CefDragHandler {
fn clone(&self) -> CefDragHandler{
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);
}
CefDragHandler {
@ -119,8 +118,7 @@ impl Clone for CefDragHandler {
impl Drop for CefDragHandler {
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);
}
}
@ -135,8 +133,7 @@ impl CefDragHandler {
}
pub unsafe fn from_c_object_addref(c_object: *mut cef_drag_handler_t) -> CefDragHandler {
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);
}
CefDragHandler {
@ -150,8 +147,7 @@ impl CefDragHandler {
pub fn c_object_addrefed(&self) -> *mut cef_drag_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
@ -159,10 +155,10 @@ impl CefDragHandler {
}
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 CefDragHandler {
pub fn on_drag_enter(&self, browser: interfaces::CefBrowser,
dragData: interfaces::CefDragData,
mask: types::cef_drag_operations_mask_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 {
@ -198,8 +193,7 @@ impl CefDragHandler {
pub fn on_draggable_regions_changed(&self, browser: interfaces::CefBrowser,
regions_count: libc::size_t,
regions: *const types::cef_draggable_region_t) -> () {
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 {
@ -229,8 +223,7 @@ impl CefWrap<*mut cef_drag_handler_t> for Option<CefDragHandler> {
}
}
unsafe fn to_rust(c_object: *mut cef_drag_handler_t) -> Option<CefDragHandler> {
if c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
if c_object.is_null() {
None
} else {
Some(CefDragHandler::from_c_object_addref(c_object))