mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
add error enum for chromium net errors, create window method for error propagation
This commit is contained in:
parent
3f8d8a3cc9
commit
68fc51205f
9 changed files with 224 additions and 0 deletions
1
ports/cef/Cargo.lock
generated
1
ports/cef/Cargo.lock
generated
|
@ -479,6 +479,7 @@ dependencies = [
|
|||
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
|
||||
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
"net 0.0.1",
|
||||
"script_traits 0.0.1",
|
||||
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -24,6 +24,7 @@ use layers::geometry::DevicePixel;
|
|||
use layers::platform::surface::NativeGraphicsMetadata;
|
||||
use libc::{c_char, c_void};
|
||||
use msg::constellation_msg::{Key, KeyModifiers};
|
||||
use net::net_error_list::NetError;
|
||||
use std::ptr;
|
||||
use std_url::Url;
|
||||
use util::cursor::Cursor;
|
||||
|
@ -360,6 +361,9 @@ impl WindowMethods for Window {
|
|||
}
|
||||
}
|
||||
|
||||
fn load_error(&self, _: NetError, _: String) {
|
||||
}
|
||||
|
||||
fn set_page_title(&self, string: Option<String>) {
|
||||
let browser = self.cef_browser.borrow();
|
||||
let browser = match *browser {
|
||||
|
|
|
@ -26,6 +26,9 @@ git = "https://github.com/servo/rust-layers"
|
|||
[dependencies.msg]
|
||||
path = "../../components/msg"
|
||||
|
||||
[dependencies.net]
|
||||
path = "../../components/net"
|
||||
|
||||
[dependencies.util]
|
||||
path = "../../components/util"
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ extern crate glutin;
|
|||
extern crate layers;
|
||||
extern crate libc;
|
||||
extern crate msg;
|
||||
extern crate net;
|
||||
#[cfg(feature = "window")] extern crate script_traits;
|
||||
extern crate time;
|
||||
extern crate util;
|
||||
|
|
|
@ -14,6 +14,7 @@ use layers::geometry::DevicePixel;
|
|||
use layers::platform::surface::NativeGraphicsMetadata;
|
||||
use msg::constellation_msg;
|
||||
use msg::constellation_msg::Key;
|
||||
use net::net_error_list::NetError;
|
||||
use std::mem;
|
||||
use std::rc::Rc;
|
||||
use std::sync::mpsc::{channel, Sender};
|
||||
|
@ -511,6 +512,9 @@ impl WindowMethods for Window {
|
|||
fn load_end(&self, _: bool, _: bool) {
|
||||
}
|
||||
|
||||
fn load_error(&self, _: NetError, _: String) {
|
||||
}
|
||||
|
||||
/// Has no effect on Android.
|
||||
fn set_cursor(&self, c: Cursor) {
|
||||
use glutin::MouseCursor;
|
||||
|
|
|
@ -12,6 +12,7 @@ use layers::geometry::DevicePixel;
|
|||
use layers::platform::surface::NativeGraphicsMetadata;
|
||||
use libc::c_int;
|
||||
use msg::constellation_msg::{Key, KeyModifiers};
|
||||
use net::net_error_list::NetError;
|
||||
use std::sync::mpsc::{channel, Sender, Receiver};
|
||||
use std::rc::Rc;
|
||||
use std::mem::transmute;
|
||||
|
@ -808,6 +809,9 @@ impl WindowMethods for Window {
|
|||
fn load_end(&self, _: bool, _: bool) {
|
||||
}
|
||||
|
||||
fn load_error(&self, _: NetError, _: String) {
|
||||
}
|
||||
|
||||
fn hidpi_factor(&self) -> ScaleFactor<ScreenPx, DevicePixel, f32> {
|
||||
ScaleFactor::new(1.0)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue