mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a
This commit is contained in:
parent
26045d7fcb
commit
d1b433a3b3
160 changed files with 1427 additions and 1162 deletions
14
src/lib.rs
14
src/lib.rs
|
@ -7,13 +7,12 @@
|
|||
|
||||
#![feature(globs, macro_rules, phase, thread_local)]
|
||||
|
||||
#![deny(unused_imports, unused_variable)]
|
||||
#![deny(unused_imports)]
|
||||
#![deny(unused_variables)]
|
||||
|
||||
#[phase(plugin, link)]
|
||||
extern crate log;
|
||||
|
||||
extern crate debug;
|
||||
|
||||
extern crate compositing;
|
||||
extern crate devtools;
|
||||
extern crate rustuv;
|
||||
|
@ -72,12 +71,17 @@ pub struct Browser<Window> {
|
|||
impl<Window> Browser<Window> where Window: WindowMethods + 'static {
|
||||
#[cfg(not(test))]
|
||||
pub fn new(window: Option<Rc<Window>>) -> Browser<Window> {
|
||||
use rustuv::EventLoop;
|
||||
fn event_loop() -> Box<green::EventLoop + Send> {
|
||||
box EventLoop::new().unwrap() as Box<green::EventLoop + Send>
|
||||
}
|
||||
|
||||
::servo_util::opts::set_experimental_enabled(opts::get().enable_experimental);
|
||||
let opts = opts::get();
|
||||
RegisterBindings::RegisterProxyHandlers();
|
||||
|
||||
let mut pool_config = green::PoolConfig::new();
|
||||
pool_config.event_loop_factory = rustuv::event_loop;
|
||||
pool_config.event_loop_factory = event_loop;
|
||||
let mut pool = green::SchedPool::new(pool_config);
|
||||
let shared_task_pool = TaskPool::new(8);
|
||||
|
||||
|
@ -125,7 +129,7 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static {
|
|||
Ok(url) => url,
|
||||
Err(url::RelativeUrlWithoutBase)
|
||||
=> url::Url::from_file_path(&cwd.join(url.as_slice())).unwrap(),
|
||||
Err(_) => fail!("URL parsing failed"),
|
||||
Err(_) => panic!("URL parsing failed"),
|
||||
};
|
||||
|
||||
let ConstellationChan(ref chan) = constellation_chan;
|
||||
|
|
26
src/main.rs
26
src/main.rs
|
@ -5,38 +5,39 @@
|
|||
#![comment = "The Servo Parallel Browser Project"]
|
||||
#![license = "MPL"]
|
||||
|
||||
#![deny(unused_imports, unused_variable)]
|
||||
#![deny(unused_imports)]
|
||||
#![deny(unused_variables)]
|
||||
|
||||
extern crate servo;
|
||||
extern crate native;
|
||||
extern crate time;
|
||||
extern crate "util" as servo_util;
|
||||
|
||||
#[cfg(not(test),not(target_os="android"))]
|
||||
#[cfg(not(any(test,target_os="android")))]
|
||||
extern crate glfw_app;
|
||||
#[cfg(not(test),not(target_os="android"))]
|
||||
#[cfg(not(any(test,target_os="android")))]
|
||||
extern crate compositing;
|
||||
|
||||
#[cfg(not(test),not(target_os="android"))]
|
||||
#[cfg(not(any(test,target_os="android")))]
|
||||
use servo_util::opts;
|
||||
|
||||
#[cfg(not(test),not(target_os="android"))]
|
||||
#[cfg(not(any(test,target_os="android")))]
|
||||
use servo_util::rtinstrument;
|
||||
|
||||
#[cfg(not(test),not(target_os="android"))]
|
||||
#[cfg(not(any(test,target_os="android")))]
|
||||
use servo::Browser;
|
||||
#[cfg(not(test),not(target_os="android"))]
|
||||
#[cfg(not(any(test,target_os="android")))]
|
||||
use compositing::windowing::{IdleWindowEvent, ResizeWindowEvent, WindowEvent};
|
||||
|
||||
#[cfg(not(test),not(target_os="android"))]
|
||||
#[cfg(not(any(test,target_os="android")))]
|
||||
use std::os;
|
||||
|
||||
#[cfg(not(test),not(target_os="android"))]
|
||||
#[cfg(not(any(test,target_os="android")))]
|
||||
struct BrowserWrapper {
|
||||
browser: Browser<glfw_app::window::Window>,
|
||||
}
|
||||
|
||||
#[cfg(not(test), not(target_os="android"))]
|
||||
#[cfg(not(any(test,target_os="android")))]
|
||||
#[start]
|
||||
#[allow(dead_code)]
|
||||
fn start(argc: int, argv: *const *const u8) -> int {
|
||||
|
@ -93,10 +94,7 @@ fn start(argc: int, argv: *const *const u8) -> int {
|
|||
})
|
||||
}
|
||||
|
||||
#[cfg(not(test), target_os="android")]
|
||||
fn main() {}
|
||||
|
||||
#[cfg(not(test),not(target_os="android"))]
|
||||
#[cfg(not(any(test,target_os="android")))]
|
||||
impl glfw_app::NestedEventLoopListener for BrowserWrapper {
|
||||
fn handle_event_from_nested_event_loop(&mut self, event: WindowEvent) -> bool {
|
||||
let is_resize = match event {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue