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

@ -113,8 +113,7 @@ pub struct CefReadHandler {
impl Clone for CefReadHandler {
fn clone(&self) -> CefReadHandler{
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);
}
CefReadHandler {
@ -127,8 +126,7 @@ impl Clone for CefReadHandler {
impl Drop for CefReadHandler {
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);
}
}
@ -143,8 +141,7 @@ impl CefReadHandler {
}
pub unsafe fn from_c_object_addref(c_object: *mut cef_read_handler_t) -> CefReadHandler {
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);
}
CefReadHandler {
@ -158,8 +155,7 @@ impl CefReadHandler {
pub fn c_object_addrefed(&self) -> *mut cef_read_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
@ -167,10 +163,10 @@ impl CefReadHandler {
}
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()
}
//
@ -178,8 +174,7 @@ impl CefReadHandler {
//
pub fn read(&self, ptr: &mut (), size: libc::size_t,
n: libc::size_t) -> libc::size_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 {
@ -197,8 +192,7 @@ impl CefReadHandler {
// SEEK_END or SEEK_SET. Return zero on success and non-zero on failure.
//
pub fn seek(&self, offset: i64, whence: 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 {
@ -214,8 +208,7 @@ impl CefReadHandler {
// Return the current offset position.
//
pub fn tell(&self) -> i64 {
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 +222,7 @@ impl CefReadHandler {
// Return non-zero if at end of file.
//
pub fn eof(&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 {
@ -246,8 +238,7 @@ impl CefReadHandler {
// the handler from.
//
pub fn may_block(&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 {
@ -274,8 +265,7 @@ impl CefWrap<*mut cef_read_handler_t> for Option<CefReadHandler> {
}
}
unsafe fn to_rust(c_object: *mut cef_read_handler_t) -> Option<CefReadHandler> {
if c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
if c_object.is_null() {
None
} else {
Some(CefReadHandler::from_c_object_addref(c_object))
@ -351,8 +341,7 @@ pub struct CefStreamReader {
impl Clone for CefStreamReader {
fn clone(&self) -> CefStreamReader{
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);
}
CefStreamReader {
@ -365,8 +354,7 @@ impl Clone for CefStreamReader {
impl Drop for CefStreamReader {
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);
}
}
@ -381,8 +369,7 @@ impl CefStreamReader {
}
pub unsafe fn from_c_object_addref(c_object: *mut cef_stream_reader_t) -> CefStreamReader {
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);
}
CefStreamReader {
@ -396,8 +383,7 @@ impl CefStreamReader {
pub fn c_object_addrefed(&self) -> *mut cef_stream_reader_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
@ -405,10 +391,10 @@ impl CefStreamReader {
}
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()
}
//
@ -416,8 +402,7 @@ impl CefStreamReader {
//
pub fn read(&self, ptr: &mut (), size: libc::size_t,
n: libc::size_t) -> libc::size_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 {
@ -435,8 +420,7 @@ impl CefStreamReader {
// SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure.
//
pub fn seek(&self, offset: i64, whence: 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 {
@ -452,8 +436,7 @@ impl CefStreamReader {
// Return the current offset position.
//
pub fn tell(&self) -> i64 {
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 +450,7 @@ impl CefStreamReader {
// Return non-zero if at end of file.
//
pub fn eof(&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 {
@ -484,8 +466,7 @@ impl CefStreamReader {
// the reader from.
//
pub fn may_block(&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 {
@ -548,8 +529,7 @@ impl CefWrap<*mut cef_stream_reader_t> for Option<CefStreamReader> {
}
}
unsafe fn to_rust(c_object: *mut cef_stream_reader_t) -> Option<CefStreamReader> {
if c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
if c_object.is_null() {
None
} else {
Some(CefStreamReader::from_c_object_addref(c_object))
@ -626,8 +606,7 @@ pub struct CefWriteHandler {
impl Clone for CefWriteHandler {
fn clone(&self) -> CefWriteHandler{
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);
}
CefWriteHandler {
@ -640,8 +619,7 @@ impl Clone for CefWriteHandler {
impl Drop for CefWriteHandler {
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);
}
}
@ -656,8 +634,7 @@ impl CefWriteHandler {
}
pub unsafe fn from_c_object_addref(c_object: *mut cef_write_handler_t) -> CefWriteHandler {
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);
}
CefWriteHandler {
@ -671,8 +648,7 @@ impl CefWriteHandler {
pub fn c_object_addrefed(&self) -> *mut cef_write_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
@ -680,10 +656,10 @@ impl CefWriteHandler {
}
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()
}
//
@ -691,8 +667,7 @@ impl CefWriteHandler {
//
pub fn write(&self, ptr: &(), size: libc::size_t,
n: libc::size_t) -> libc::size_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 {
@ -710,8 +685,7 @@ impl CefWriteHandler {
// SEEK_END or SEEK_SET. Return zero on success and non-zero on failure.
//
pub fn seek(&self, offset: i64, whence: 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 {
@ -727,8 +701,7 @@ impl CefWriteHandler {
// Return the current offset position.
//
pub fn tell(&self) -> i64 {
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 {
@ -742,8 +715,7 @@ impl CefWriteHandler {
// Flush the stream.
//
pub fn flush(&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 {
@ -759,8 +731,7 @@ impl CefWriteHandler {
// the handler from.
//
pub fn may_block(&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 {
@ -787,8 +758,7 @@ impl CefWrap<*mut cef_write_handler_t> for Option<CefWriteHandler> {
}
}
unsafe fn to_rust(c_object: *mut cef_write_handler_t) -> Option<CefWriteHandler> {
if c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
if c_object.is_null() {
None
} else {
Some(CefWriteHandler::from_c_object_addref(c_object))
@ -865,8 +835,7 @@ pub struct CefStreamWriter {
impl Clone for CefStreamWriter {
fn clone(&self) -> CefStreamWriter{
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);
}
CefStreamWriter {
@ -879,8 +848,7 @@ impl Clone for CefStreamWriter {
impl Drop for CefStreamWriter {
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);
}
}
@ -895,8 +863,7 @@ impl CefStreamWriter {
}
pub unsafe fn from_c_object_addref(c_object: *mut cef_stream_writer_t) -> CefStreamWriter {
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);
}
CefStreamWriter {
@ -910,8 +877,7 @@ impl CefStreamWriter {
pub fn c_object_addrefed(&self) -> *mut cef_stream_writer_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
@ -919,10 +885,10 @@ impl CefStreamWriter {
}
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()
}
//
@ -930,8 +896,7 @@ impl CefStreamWriter {
//
pub fn write(&self, ptr: &(), size: libc::size_t,
n: libc::size_t) -> libc::size_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 {
@ -949,8 +914,7 @@ impl CefStreamWriter {
// SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure.
//
pub fn seek(&self, offset: i64, whence: 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 {
@ -966,8 +930,7 @@ impl CefStreamWriter {
// Return the current offset position.
//
pub fn tell(&self) -> i64 {
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 {
@ -981,8 +944,7 @@ impl CefStreamWriter {
// Flush the stream.
//
pub fn flush(&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 {
@ -998,8 +960,7 @@ impl CefStreamWriter {
// the writer from.
//
pub fn may_block(&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 {
@ -1049,8 +1010,7 @@ impl CefWrap<*mut cef_stream_writer_t> for Option<CefStreamWriter> {
}
}
unsafe fn to_rust(c_object: *mut cef_stream_writer_t) -> Option<CefStreamWriter> {
if c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
if c_object.is_null() {
None
} else {
Some(CefStreamWriter::from_c_object_addref(c_object))