mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15: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
|
@ -92,8 +92,7 @@ pub struct CefRequestCallback {
|
|||
impl Clone for CefRequestCallback {
|
||||
fn clone(&self) -> CefRequestCallback{
|
||||
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);
|
||||
}
|
||||
CefRequestCallback {
|
||||
|
@ -106,8 +105,7 @@ impl Clone for CefRequestCallback {
|
|||
impl Drop for CefRequestCallback {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -122,8 +120,7 @@ impl CefRequestCallback {
|
|||
}
|
||||
|
||||
pub unsafe fn from_c_object_addref(c_object: *mut cef_request_callback_t) -> CefRequestCallback {
|
||||
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);
|
||||
}
|
||||
CefRequestCallback {
|
||||
|
@ -137,8 +134,7 @@ impl CefRequestCallback {
|
|||
|
||||
pub fn c_object_addrefed(&self) -> *mut cef_request_callback_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
|
||||
|
@ -146,10 +142,10 @@ impl CefRequestCallback {
|
|||
}
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -157,8 +153,7 @@ impl CefRequestCallback {
|
|||
// continued. Otherwise, the request will be canceled.
|
||||
//
|
||||
pub fn cont(&self, allow: 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 {
|
||||
|
@ -173,8 +168,7 @@ impl CefRequestCallback {
|
|||
// Cancel the url request.
|
||||
//
|
||||
pub fn cancel(&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 {
|
||||
|
@ -201,8 +195,7 @@ impl CefWrap<*mut cef_request_callback_t> for Option<CefRequestCallback> {
|
|||
}
|
||||
}
|
||||
unsafe fn to_rust(c_object: *mut cef_request_callback_t) -> Option<CefRequestCallback> {
|
||||
if c_object.is_null() &&
|
||||
c_object as usize != mem::POST_DROP_USIZE {
|
||||
if c_object.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(CefRequestCallback::from_c_object_addref(c_object))
|
||||
|
@ -426,8 +419,7 @@ pub struct CefRequestHandler {
|
|||
impl Clone for CefRequestHandler {
|
||||
fn clone(&self) -> CefRequestHandler{
|
||||
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);
|
||||
}
|
||||
CefRequestHandler {
|
||||
|
@ -440,8 +432,7 @@ impl Clone for CefRequestHandler {
|
|||
impl Drop for CefRequestHandler {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -456,8 +447,7 @@ impl CefRequestHandler {
|
|||
}
|
||||
|
||||
pub unsafe fn from_c_object_addref(c_object: *mut cef_request_handler_t) -> CefRequestHandler {
|
||||
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);
|
||||
}
|
||||
CefRequestHandler {
|
||||
|
@ -471,8 +461,7 @@ impl CefRequestHandler {
|
|||
|
||||
pub fn c_object_addrefed(&self) -> *mut cef_request_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
|
||||
|
@ -480,10 +469,10 @@ impl CefRequestHandler {
|
|||
}
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -499,8 +488,7 @@ impl CefRequestHandler {
|
|||
pub fn on_before_browse(&self, browser: interfaces::CefBrowser,
|
||||
frame: interfaces::CefFrame, request: interfaces::CefRequest,
|
||||
is_redirect: 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 {
|
||||
|
@ -534,8 +522,7 @@ impl CefRequestHandler {
|
|||
frame: interfaces::CefFrame, target_url: &[u16],
|
||||
target_disposition: types::cef_window_open_disposition_t,
|
||||
user_gesture: 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 {
|
||||
|
@ -561,8 +548,7 @@ impl CefRequestHandler {
|
|||
pub fn on_before_resource_load(&self, browser: interfaces::CefBrowser,
|
||||
frame: interfaces::CefFrame, request: interfaces::CefRequest,
|
||||
callback: interfaces::CefRequestCallback) -> types::cef_return_value_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 {
|
||||
|
@ -585,8 +571,7 @@ impl CefRequestHandler {
|
|||
pub fn get_resource_handler(&self, browser: interfaces::CefBrowser,
|
||||
frame: interfaces::CefFrame,
|
||||
request: interfaces::CefRequest) -> interfaces::CefResourceHandler {
|
||||
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 {
|
||||
|
@ -608,8 +593,7 @@ impl CefRequestHandler {
|
|||
pub fn on_resource_redirect(&self, browser: interfaces::CefBrowser,
|
||||
frame: interfaces::CefFrame, request: interfaces::CefRequest,
|
||||
new_url: *mut types::cef_string_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 {
|
||||
|
@ -632,8 +616,7 @@ impl CefRequestHandler {
|
|||
pub fn on_resource_response(&self, browser: interfaces::CefBrowser,
|
||||
frame: interfaces::CefFrame, request: interfaces::CefRequest,
|
||||
response: interfaces::CefResponse) -> 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 {
|
||||
|
@ -659,8 +642,7 @@ impl CefRequestHandler {
|
|||
frame: interfaces::CefFrame, isProxy: libc::c_int, host: &[u16],
|
||||
port: libc::c_int, realm: &[u16], scheme: &[u16],
|
||||
callback: interfaces::CefAuthCallback) -> 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 {
|
||||
|
@ -690,8 +672,7 @@ impl CefRequestHandler {
|
|||
pub fn on_quota_request(&self, browser: interfaces::CefBrowser,
|
||||
origin_url: &[u16], new_size: i64,
|
||||
callback: interfaces::CefRequestCallback) -> 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 {
|
||||
|
@ -714,8 +695,7 @@ impl CefRequestHandler {
|
|||
//
|
||||
pub fn on_protocol_execution(&self, browser: interfaces::CefBrowser,
|
||||
url: &[u16], allow_os_execution: &mut 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 {
|
||||
|
@ -741,8 +721,7 @@ impl CefRequestHandler {
|
|||
cert_error: types::cef_errorcode_t, request_url: &[u16],
|
||||
ssl_info: interfaces::CefSSLInfo,
|
||||
callback: interfaces::CefRequestCallback) -> 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 {
|
||||
|
@ -764,8 +743,7 @@ impl CefRequestHandler {
|
|||
pub fn on_before_plugin_load(&self, browser: interfaces::CefBrowser,
|
||||
url: &[u16], policy_url: &[u16],
|
||||
info: interfaces::CefWebPluginInfo) -> 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 {
|
||||
|
@ -785,8 +763,7 @@ impl CefRequestHandler {
|
|||
//
|
||||
pub fn on_plugin_crashed(&self, browser: interfaces::CefBrowser,
|
||||
plugin_path: &[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 {
|
||||
|
@ -804,8 +781,7 @@ impl CefRequestHandler {
|
|||
// process.
|
||||
//
|
||||
pub fn on_render_view_ready(&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 {
|
||||
|
@ -822,8 +798,7 @@ impl CefRequestHandler {
|
|||
//
|
||||
pub fn on_render_process_terminated(&self, browser: interfaces::CefBrowser,
|
||||
status: types::cef_termination_status_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 {
|
||||
|
@ -852,8 +827,7 @@ impl CefWrap<*mut cef_request_handler_t> for Option<CefRequestHandler> {
|
|||
}
|
||||
}
|
||||
unsafe fn to_rust(c_object: *mut cef_request_handler_t) -> Option<CefRequestHandler> {
|
||||
if c_object.is_null() &&
|
||||
c_object as usize != mem::POST_DROP_USIZE {
|
||||
if c_object.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(CefRequestHandler::from_c_object_addref(c_object))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue