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

@ -95,8 +95,7 @@ pub struct CefTask {
impl Clone for CefTask {
fn clone(&self) -> CefTask{
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);
}
CefTask {
@ -109,8 +108,7 @@ impl Clone for CefTask {
impl Drop for CefTask {
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);
}
}
@ -125,8 +123,7 @@ impl CefTask {
}
pub unsafe fn from_c_object_addref(c_object: *mut cef_task_t) -> CefTask {
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);
}
CefTask {
@ -140,8 +137,7 @@ impl CefTask {
pub fn c_object_addrefed(&self) -> *mut cef_task_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
@ -149,18 +145,17 @@ impl CefTask {
}
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()
}
//
// Method that will be executed on the target thread.
//
pub fn execute(&self) -> () {
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 {
@ -187,8 +182,7 @@ impl CefWrap<*mut cef_task_t> for Option<CefTask> {
}
}
unsafe fn to_rust(c_object: *mut cef_task_t) -> Option<CefTask> {
if c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
if c_object.is_null() {
None
} else {
Some(CefTask::from_c_object_addref(c_object))
@ -278,8 +272,7 @@ pub struct CefTaskRunner {
impl Clone for CefTaskRunner {
fn clone(&self) -> CefTaskRunner{
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);
}
CefTaskRunner {
@ -292,8 +285,7 @@ impl Clone for CefTaskRunner {
impl Drop for CefTaskRunner {
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);
}
}
@ -308,8 +300,7 @@ impl CefTaskRunner {
}
pub unsafe fn from_c_object_addref(c_object: *mut cef_task_runner_t) -> CefTaskRunner {
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);
}
CefTaskRunner {
@ -323,8 +314,7 @@ impl CefTaskRunner {
pub fn c_object_addrefed(&self) -> *mut cef_task_runner_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
@ -332,10 +322,10 @@ impl CefTaskRunner {
}
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()
}
//
@ -343,8 +333,7 @@ impl CefTaskRunner {
// |that| object.
//
pub fn is_same(&self, that: interfaces::CefTaskRunner) -> 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 {
@ -359,8 +348,7 @@ impl CefTaskRunner {
// Returns true (1) if this task runner belongs to the current thread.
//
pub fn belongs_to_current_thread(&self) -> 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 {
@ -375,8 +363,7 @@ impl CefTaskRunner {
//
pub fn belongs_to_thread(&self,
threadId: types::cef_thread_id_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 {
@ -392,8 +379,7 @@ impl CefTaskRunner {
// Execution will occur asynchronously.
//
pub fn post_task(&self, task: interfaces::CefTask) -> 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 {
@ -412,8 +398,7 @@ impl CefTaskRunner {
//
pub fn post_delayed_task(&self, task: interfaces::CefTask,
delay_ms: i64) -> 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 {
@ -467,8 +452,7 @@ impl CefWrap<*mut cef_task_runner_t> for Option<CefTaskRunner> {
}
}
unsafe fn to_rust(c_object: *mut cef_task_runner_t) -> Option<CefTaskRunner> {
if c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
if c_object.is_null() {
None
} else {
Some(CefTaskRunner::from_c_object_addref(c_object))