mirror of
https://github.com/servo/servo.git
synced 2025-08-12 17:05: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
|
@ -227,8 +227,7 @@ pub struct CefDragData {
|
|||
impl Clone for CefDragData {
|
||||
fn clone(&self) -> CefDragData{
|
||||
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);
|
||||
}
|
||||
CefDragData {
|
||||
|
@ -241,8 +240,7 @@ impl Clone for CefDragData {
|
|||
impl Drop for CefDragData {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -257,8 +255,7 @@ impl CefDragData {
|
|||
}
|
||||
|
||||
pub unsafe fn from_c_object_addref(c_object: *mut cef_drag_data_t) -> CefDragData {
|
||||
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);
|
||||
}
|
||||
CefDragData {
|
||||
|
@ -272,8 +269,7 @@ impl CefDragData {
|
|||
|
||||
pub fn c_object_addrefed(&self) -> *mut cef_drag_data_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
|
||||
|
@ -281,18 +277,17 @@ impl CefDragData {
|
|||
}
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
//
|
||||
// Returns a copy of the current object.
|
||||
//
|
||||
pub fn clone(&self) -> interfaces::CefDragData {
|
||||
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 {
|
||||
|
@ -306,8 +301,7 @@ impl CefDragData {
|
|||
// Returns true (1) if this object is read-only.
|
||||
//
|
||||
pub fn is_read_only(&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 {
|
||||
|
@ -321,8 +315,7 @@ impl CefDragData {
|
|||
// Returns true (1) if the drag data is a link.
|
||||
//
|
||||
pub fn is_link(&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 {
|
||||
|
@ -336,8 +329,7 @@ impl CefDragData {
|
|||
// Returns true (1) if the drag data is a text or html fragment.
|
||||
//
|
||||
pub fn is_fragment(&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 {
|
||||
|
@ -351,8 +343,7 @@ impl CefDragData {
|
|||
// Returns true (1) if the drag data is a file.
|
||||
//
|
||||
pub fn is_file(&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 {
|
||||
|
@ -367,8 +358,7 @@ impl CefDragData {
|
|||
//
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
pub fn get_link_url(&self) -> String {
|
||||
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 {
|
||||
|
@ -383,8 +373,7 @@ impl CefDragData {
|
|||
//
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
pub fn get_link_title(&self) -> String {
|
||||
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 +388,7 @@ impl CefDragData {
|
|||
//
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
pub fn get_link_metadata(&self) -> String {
|
||||
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 {
|
||||
|
@ -415,8 +403,7 @@ impl CefDragData {
|
|||
//
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
pub fn get_fragment_text(&self) -> String {
|
||||
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 {
|
||||
|
@ -431,8 +418,7 @@ impl CefDragData {
|
|||
//
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
pub fn get_fragment_html(&self) -> String {
|
||||
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 {
|
||||
|
@ -448,8 +434,7 @@ impl CefDragData {
|
|||
//
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
pub fn get_fragment_base_url(&self) -> String {
|
||||
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 {
|
||||
|
@ -464,8 +449,7 @@ impl CefDragData {
|
|||
//
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
pub fn get_file_name(&self) -> String {
|
||||
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 {
|
||||
|
@ -483,8 +467,7 @@ impl CefDragData {
|
|||
//
|
||||
pub fn get_file_contents(&self,
|
||||
writer: interfaces::CefStreamWriter) -> 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 {
|
||||
|
@ -500,8 +483,7 @@ impl CefDragData {
|
|||
// window.
|
||||
//
|
||||
pub fn get_file_names(&self, names: &Vec<String>) -> 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 {
|
||||
|
@ -516,8 +498,7 @@ impl CefDragData {
|
|||
// Set the link URL that is being dragged.
|
||||
//
|
||||
pub fn set_link_url(&self, url: &[u16]) -> () {
|
||||
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 {
|
||||
|
@ -532,8 +513,7 @@ impl CefDragData {
|
|||
// Set the title associated with the link being dragged.
|
||||
//
|
||||
pub fn set_link_title(&self, title: &[u16]) -> () {
|
||||
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 +528,7 @@ impl CefDragData {
|
|||
// Set the metadata associated with the link being dragged.
|
||||
//
|
||||
pub fn set_link_metadata(&self, data: &[u16]) -> () {
|
||||
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 {
|
||||
|
@ -564,8 +543,7 @@ impl CefDragData {
|
|||
// Set the plain text fragment that is being dragged.
|
||||
//
|
||||
pub fn set_fragment_text(&self, text: &[u16]) -> () {
|
||||
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 {
|
||||
|
@ -580,8 +558,7 @@ impl CefDragData {
|
|||
// Set the text/html fragment that is being dragged.
|
||||
//
|
||||
pub fn set_fragment_html(&self, html: &[u16]) -> () {
|
||||
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 {
|
||||
|
@ -596,8 +573,7 @@ impl CefDragData {
|
|||
// Set the base URL that the fragment came from.
|
||||
//
|
||||
pub fn set_fragment_base_url(&self, base_url: &[u16]) -> () {
|
||||
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 {
|
||||
|
@ -614,8 +590,7 @@ impl CefDragData {
|
|||
// to drag in this kind of data.
|
||||
//
|
||||
pub fn reset_file_contents(&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 {
|
||||
|
@ -629,8 +604,7 @@ impl CefDragData {
|
|||
// Add a file that is being dragged into the webview.
|
||||
//
|
||||
pub fn add_file(&self, path: &[u16], display_name: &[u16]) -> () {
|
||||
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 {
|
||||
|
@ -670,8 +644,7 @@ impl CefWrap<*mut cef_drag_data_t> for Option<CefDragData> {
|
|||
}
|
||||
}
|
||||
unsafe fn to_rust(c_object: *mut cef_drag_data_t) -> Option<CefDragData> {
|
||||
if c_object.is_null() &&
|
||||
c_object as usize != mem::POST_DROP_USIZE {
|
||||
if c_object.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(CefDragData::from_c_object_addref(c_object))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue