mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
Update Rust to 1.13.0-nightly (198713106 2016-08-26)
This commit is contained in:
parent
f4d3281a6a
commit
c66380d83c
64 changed files with 1428 additions and 2636 deletions
|
@ -130,8 +130,7 @@ pub struct CefSchemeRegistrar {
|
|||
impl Clone for CefSchemeRegistrar {
|
||||
fn clone(&self) -> CefSchemeRegistrar{
|
||||
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);
|
||||
}
|
||||
CefSchemeRegistrar {
|
||||
|
@ -144,8 +143,7 @@ impl Clone for CefSchemeRegistrar {
|
|||
impl Drop for CefSchemeRegistrar {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -160,8 +158,7 @@ impl CefSchemeRegistrar {
|
|||
}
|
||||
|
||||
pub unsafe fn from_c_object_addref(c_object: *mut cef_scheme_registrar_t) -> CefSchemeRegistrar {
|
||||
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);
|
||||
}
|
||||
CefSchemeRegistrar {
|
||||
|
@ -175,8 +172,7 @@ impl CefSchemeRegistrar {
|
|||
|
||||
pub fn c_object_addrefed(&self) -> *mut cef_scheme_registrar_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
|
||||
|
@ -184,10 +180,10 @@ impl CefSchemeRegistrar {
|
|||
}
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -239,8 +235,7 @@ impl CefSchemeRegistrar {
|
|||
pub fn add_custom_scheme(&self, scheme_name: &[u16], is_standard: libc::c_int,
|
||||
is_local: libc::c_int,
|
||||
is_display_isolated: libc::c_int) -> 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 {
|
||||
|
@ -271,8 +266,7 @@ impl CefWrap<*mut cef_scheme_registrar_t> for Option<CefSchemeRegistrar> {
|
|||
}
|
||||
}
|
||||
unsafe fn to_rust(c_object: *mut cef_scheme_registrar_t) -> Option<CefSchemeRegistrar> {
|
||||
if c_object.is_null() &&
|
||||
c_object as usize != mem::POST_DROP_USIZE {
|
||||
if c_object.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(CefSchemeRegistrar::from_c_object_addref(c_object))
|
||||
|
@ -333,8 +327,7 @@ pub struct CefSchemeHandlerFactory {
|
|||
impl Clone for CefSchemeHandlerFactory {
|
||||
fn clone(&self) -> CefSchemeHandlerFactory{
|
||||
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);
|
||||
}
|
||||
CefSchemeHandlerFactory {
|
||||
|
@ -347,8 +340,7 @@ impl Clone for CefSchemeHandlerFactory {
|
|||
impl Drop for CefSchemeHandlerFactory {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -363,8 +355,7 @@ impl CefSchemeHandlerFactory {
|
|||
}
|
||||
|
||||
pub unsafe fn from_c_object_addref(c_object: *mut cef_scheme_handler_factory_t) -> CefSchemeHandlerFactory {
|
||||
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);
|
||||
}
|
||||
CefSchemeHandlerFactory {
|
||||
|
@ -378,8 +369,7 @@ impl CefSchemeHandlerFactory {
|
|||
|
||||
pub fn c_object_addrefed(&self) -> *mut cef_scheme_handler_factory_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
|
||||
|
@ -387,10 +377,10 @@ impl CefSchemeHandlerFactory {
|
|||
}
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -404,8 +394,7 @@ impl CefSchemeHandlerFactory {
|
|||
pub fn create(&self, browser: interfaces::CefBrowser,
|
||||
frame: interfaces::CefFrame, scheme_name: &[u16],
|
||||
request: interfaces::CefRequest) -> interfaces::CefResourceHandler {
|
||||
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 {
|
||||
|
@ -436,8 +425,7 @@ impl CefWrap<*mut cef_scheme_handler_factory_t> for Option<CefSchemeHandlerFacto
|
|||
}
|
||||
}
|
||||
unsafe fn to_rust(c_object: *mut cef_scheme_handler_factory_t) -> Option<CefSchemeHandlerFactory> {
|
||||
if c_object.is_null() &&
|
||||
c_object as usize != mem::POST_DROP_USIZE {
|
||||
if c_object.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(CefSchemeHandlerFactory::from_c_object_addref(c_object))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue