mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35: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
|
@ -239,8 +239,7 @@ pub struct CefFrame {
|
|||
impl Clone for CefFrame {
|
||||
fn clone(&self) -> CefFrame{
|
||||
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);
|
||||
}
|
||||
CefFrame {
|
||||
|
@ -253,8 +252,7 @@ impl Clone for CefFrame {
|
|||
impl Drop for CefFrame {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -269,8 +267,7 @@ impl CefFrame {
|
|||
}
|
||||
|
||||
pub unsafe fn from_c_object_addref(c_object: *mut cef_frame_t) -> CefFrame {
|
||||
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);
|
||||
}
|
||||
CefFrame {
|
||||
|
@ -284,8 +281,7 @@ impl CefFrame {
|
|||
|
||||
pub fn c_object_addrefed(&self) -> *mut cef_frame_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
|
||||
|
@ -293,18 +289,17 @@ impl CefFrame {
|
|||
}
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
//
|
||||
// True if this object is currently attached to a valid frame.
|
||||
//
|
||||
pub fn is_valid(&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 {
|
||||
|
@ -318,8 +313,7 @@ impl CefFrame {
|
|||
// Execute undo in this frame.
|
||||
//
|
||||
pub fn undo(&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 {
|
||||
|
@ -333,8 +327,7 @@ impl CefFrame {
|
|||
// Execute redo in this frame.
|
||||
//
|
||||
pub fn redo(&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 {
|
||||
|
@ -348,8 +341,7 @@ impl CefFrame {
|
|||
// Execute cut in this frame.
|
||||
//
|
||||
pub fn cut(&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 {
|
||||
|
@ -363,8 +355,7 @@ impl CefFrame {
|
|||
// Execute copy in this frame.
|
||||
//
|
||||
pub fn copy(&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 {
|
||||
|
@ -378,8 +369,7 @@ impl CefFrame {
|
|||
// Execute paste in this frame.
|
||||
//
|
||||
pub fn paste(&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 {
|
||||
|
@ -393,8 +383,7 @@ impl CefFrame {
|
|||
// Execute delete in this frame.
|
||||
//
|
||||
pub fn del(&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 {
|
||||
|
@ -408,8 +397,7 @@ impl CefFrame {
|
|||
// Execute select all in this frame.
|
||||
//
|
||||
pub fn select_all(&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 {
|
||||
|
@ -425,8 +413,7 @@ impl CefFrame {
|
|||
// browser process.
|
||||
//
|
||||
pub fn view_source(&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 {
|
||||
|
@ -441,8 +428,7 @@ impl CefFrame {
|
|||
// visitor.
|
||||
//
|
||||
pub fn get_source(&self, visitor: interfaces::CefStringVisitor) -> () {
|
||||
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 {
|
||||
|
@ -458,8 +444,7 @@ impl CefFrame {
|
|||
// visitor.
|
||||
//
|
||||
pub fn get_text(&self, visitor: interfaces::CefStringVisitor) -> () {
|
||||
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 {
|
||||
|
@ -474,8 +459,7 @@ impl CefFrame {
|
|||
// Load the request represented by the |request| object.
|
||||
//
|
||||
pub fn load_request(&self, request: interfaces::CefRequest) -> () {
|
||||
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 {
|
||||
|
@ -490,8 +474,7 @@ impl CefFrame {
|
|||
// Load the specified |url|.
|
||||
//
|
||||
pub fn load_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 {
|
||||
|
@ -508,8 +491,7 @@ impl CefFrame {
|
|||
// link clicks and web security restrictions may not behave as expected.
|
||||
//
|
||||
pub fn load_string(&self, string_val: &[u16], 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 {
|
||||
|
@ -530,8 +512,7 @@ impl CefFrame {
|
|||
//
|
||||
pub fn execute_java_script(&self, code: &[u16], script_url: &[u16],
|
||||
start_line: 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 CefFrame {
|
|||
// Returns true (1) if this is the main (top-level) frame.
|
||||
//
|
||||
pub fn is_main(&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 {
|
||||
|
@ -563,8 +543,7 @@ impl CefFrame {
|
|||
// Returns true (1) if this is the focused frame.
|
||||
//
|
||||
pub fn is_focused(&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 {
|
||||
|
@ -583,8 +562,7 @@ impl CefFrame {
|
|||
//
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
pub fn get_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 {
|
||||
|
@ -598,8 +576,7 @@ impl CefFrame {
|
|||
// Returns the globally unique identifier for this frame.
|
||||
//
|
||||
pub fn get_identifier(&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 {
|
||||
|
@ -614,8 +591,7 @@ impl CefFrame {
|
|||
// frame.
|
||||
//
|
||||
pub fn get_parent(&self) -> interfaces::CefFrame {
|
||||
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 {
|
||||
|
@ -630,8 +606,7 @@ impl CefFrame {
|
|||
//
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
pub fn get_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 {
|
||||
|
@ -645,8 +620,7 @@ impl CefFrame {
|
|||
// Returns the browser that this frame belongs to.
|
||||
//
|
||||
pub fn get_browser(&self) -> 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 {
|
||||
|
@ -661,8 +635,7 @@ impl CefFrame {
|
|||
// called from the render process.
|
||||
//
|
||||
pub fn get_v8context(&self) -> interfaces::CefV8Context {
|
||||
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 {
|
||||
|
@ -677,8 +650,7 @@ impl CefFrame {
|
|||
// process.
|
||||
//
|
||||
pub fn visit_dom(&self, visitor: interfaces::CefDOMVisitor) -> () {
|
||||
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 {
|
||||
|
@ -706,8 +678,7 @@ impl CefWrap<*mut cef_frame_t> for Option<CefFrame> {
|
|||
}
|
||||
}
|
||||
unsafe fn to_rust(c_object: *mut cef_frame_t) -> Option<CefFrame> {
|
||||
if c_object.is_null() &&
|
||||
c_object as usize != mem::POST_DROP_USIZE {
|
||||
if c_object.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(CefFrame::from_c_object_addref(c_object))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue