mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Urlmageddon: Use refcounted urls more often.
This commit is contained in:
parent
f14e7339b5
commit
913c874cb5
161 changed files with 1044 additions and 718 deletions
|
@ -23,9 +23,9 @@ profile_traits = {path = "../profile_traits"}
|
|||
script_traits = {path = "../script_traits"}
|
||||
serde = "0.8"
|
||||
serde_derive = "0.8"
|
||||
servo_url = {path = "../url", features = ["servo"]}
|
||||
style_traits = {path = "../style_traits"}
|
||||
time = "0.1.17"
|
||||
url = {version = "1.2", features = ["heap_size"]}
|
||||
util = {path = "../util"}
|
||||
|
||||
[dependencies.webrender]
|
||||
|
|
|
@ -26,6 +26,7 @@ use script_traits::{ConstellationMsg, LayoutControlMsg, LoadData, MouseButton};
|
|||
use script_traits::{MouseEventType, StackingContextScrollState};
|
||||
use script_traits::{TouchpadPressurePhase, TouchEventType, TouchId, WindowSizeData, WindowSizeType};
|
||||
use script_traits::CompositorEvent::{self, MouseMoveEvent, MouseButtonEvent, TouchEvent, TouchpadPressureEvent};
|
||||
use servo_url::ServoUrl;
|
||||
use std::collections::HashMap;
|
||||
use std::fs::File;
|
||||
use std::rc::Rc;
|
||||
|
@ -34,7 +35,6 @@ use style_traits::{PagePx, ViewportPx};
|
|||
use style_traits::viewport::ViewportConstraints;
|
||||
use time::{precise_time_ns, precise_time_s};
|
||||
use touch::{TouchHandler, TouchAction};
|
||||
use url::Url;
|
||||
use util::geometry::ScreenPx;
|
||||
use util::opts;
|
||||
use util::prefs::PREFS;
|
||||
|
@ -697,7 +697,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
}
|
||||
}
|
||||
|
||||
fn change_page_url(&mut self, _: PipelineId, url: Url) {
|
||||
fn change_page_url(&mut self, _: PipelineId, url: ServoUrl) {
|
||||
self.window.set_page_url(url);
|
||||
}
|
||||
|
||||
|
@ -881,7 +881,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
fn on_load_url_window_event(&mut self, url_string: String) {
|
||||
debug!("osmain: loading URL `{}`", url_string);
|
||||
self.got_load_complete_message = false;
|
||||
match Url::parse(&url_string) {
|
||||
match ServoUrl::parse(&url_string) {
|
||||
Ok(url) => {
|
||||
self.window.set_page_url(url.clone());
|
||||
let msg = match self.root_pipeline {
|
||||
|
|
|
@ -14,11 +14,11 @@ use net_traits::image::base::Image;
|
|||
use profile_traits::mem;
|
||||
use profile_traits::time;
|
||||
use script_traits::{AnimationState, ConstellationMsg, EventResult};
|
||||
use servo_url::ServoUrl;
|
||||
use std::fmt::{Debug, Error, Formatter};
|
||||
use std::sync::mpsc::{Receiver, Sender};
|
||||
use style_traits::cursor::Cursor;
|
||||
use style_traits::viewport::ViewportConstraints;
|
||||
use url::Url;
|
||||
use webrender;
|
||||
use webrender_traits;
|
||||
|
||||
|
@ -76,7 +76,7 @@ pub enum Msg {
|
|||
/// Alerts the compositor that the current page has changed its title.
|
||||
ChangePageTitle(PipelineId, Option<String>),
|
||||
/// Alerts the compositor that the current page has changed its URL.
|
||||
ChangePageUrl(PipelineId, Url),
|
||||
ChangePageUrl(PipelineId, ServoUrl),
|
||||
/// Alerts the compositor that the given pipeline has changed whether it is running animations.
|
||||
ChangeRunningAnimationsState(PipelineId, AnimationState),
|
||||
/// Replaces the current frame tree, typically called during main frame navigation.
|
||||
|
@ -102,7 +102,7 @@ pub enum Msg {
|
|||
/// A reply to the compositor asking if the output image is stable.
|
||||
IsReadyToSaveImageReply(bool),
|
||||
/// A favicon was detected
|
||||
NewFavicon(Url),
|
||||
NewFavicon(ServoUrl),
|
||||
/// <head> tag finished parsing
|
||||
HeadParsed,
|
||||
/// A status message to be displayed by the browser chrome.
|
||||
|
|
|
@ -23,9 +23,9 @@ extern crate profile_traits;
|
|||
extern crate script_traits;
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
extern crate servo_url;
|
||||
extern crate style_traits;
|
||||
extern crate time;
|
||||
extern crate url;
|
||||
#[macro_use]
|
||||
extern crate util;
|
||||
extern crate webrender;
|
||||
|
|
|
@ -13,9 +13,9 @@ use gfx_traits::DevicePixel;
|
|||
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
|
||||
use net_traits::net_error_list::NetError;
|
||||
use script_traits::{MouseButton, TouchEventType, TouchId, TouchpadPressurePhase};
|
||||
use servo_url::ServoUrl;
|
||||
use std::fmt::{Debug, Error, Formatter};
|
||||
use style_traits::cursor::Cursor;
|
||||
use url::Url;
|
||||
use util::geometry::ScreenPx;
|
||||
|
||||
#[derive(Clone)]
|
||||
|
@ -123,7 +123,7 @@ pub trait WindowMethods {
|
|||
/// Sets the page title for the current page.
|
||||
fn set_page_title(&self, title: Option<String>);
|
||||
/// Sets the load data for the current page.
|
||||
fn set_page_url(&self, url: Url);
|
||||
fn set_page_url(&self, url: ServoUrl);
|
||||
/// Called when the browser chrome should display a status message.
|
||||
fn status(&self, Option<String>);
|
||||
/// Called when the browser has started loading a frame.
|
||||
|
@ -160,5 +160,5 @@ pub trait WindowMethods {
|
|||
fn supports_clipboard(&self) -> bool;
|
||||
|
||||
/// Add a favicon
|
||||
fn set_favicon(&self, url: Url);
|
||||
fn set_favicon(&self, url: ServoUrl);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue