mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +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
|
@ -199,8 +199,7 @@ pub struct CefLifeSpanHandler {
|
|||
impl Clone for CefLifeSpanHandler {
|
||||
fn clone(&self) -> CefLifeSpanHandler{
|
||||
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);
|
||||
}
|
||||
CefLifeSpanHandler {
|
||||
|
@ -213,8 +212,7 @@ impl Clone for CefLifeSpanHandler {
|
|||
impl Drop for CefLifeSpanHandler {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -229,8 +227,7 @@ impl CefLifeSpanHandler {
|
|||
}
|
||||
|
||||
pub unsafe fn from_c_object_addref(c_object: *mut cef_life_span_handler_t) -> CefLifeSpanHandler {
|
||||
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);
|
||||
}
|
||||
CefLifeSpanHandler {
|
||||
|
@ -244,8 +241,7 @@ impl CefLifeSpanHandler {
|
|||
|
||||
pub fn c_object_addrefed(&self) -> *mut cef_life_span_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
|
||||
|
@ -253,10 +249,10 @@ impl CefLifeSpanHandler {
|
|||
}
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -285,8 +281,7 @@ impl CefLifeSpanHandler {
|
|||
client: interfaces::CefClient,
|
||||
settings: &mut interfaces::CefBrowserSettings,
|
||||
no_javascript_access: &mut 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 {
|
||||
|
@ -311,8 +306,7 @@ impl CefLifeSpanHandler {
|
|||
// Called after a new browser is created.
|
||||
//
|
||||
pub fn on_after_created(&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 {
|
||||
|
@ -329,8 +323,7 @@ impl CefLifeSpanHandler {
|
|||
// implementation or true (1) to use a custom implementation.
|
||||
//
|
||||
pub fn run_modal(&self, browser: interfaces::CefBrowser) -> 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 {
|
||||
|
@ -399,8 +392,7 @@ impl CefLifeSpanHandler {
|
|||
// exist.
|
||||
//
|
||||
pub fn do_close(&self, browser: interfaces::CefBrowser) -> 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 {
|
||||
|
@ -420,8 +412,7 @@ impl CefLifeSpanHandler {
|
|||
// additional usage information.
|
||||
//
|
||||
pub fn on_before_close(&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 {
|
||||
|
@ -449,8 +440,7 @@ impl CefWrap<*mut cef_life_span_handler_t> for Option<CefLifeSpanHandler> {
|
|||
}
|
||||
}
|
||||
unsafe fn to_rust(c_object: *mut cef_life_span_handler_t) -> Option<CefLifeSpanHandler> {
|
||||
if c_object.is_null() &&
|
||||
c_object as usize != mem::POST_DROP_USIZE {
|
||||
if c_object.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(CefLifeSpanHandler::from_c_object_addref(c_object))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue