diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index cf303102ba3..02461adb15d 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -274,8 +274,8 @@ impl IOCompositor { self.change_page_title(pipeline_id, title); } - (Msg::ChangePageLoadData(frame_id, load_data), ShutdownState::NotShuttingDown) => { - self.change_page_load_data(frame_id, load_data); + (Msg::ChangePageUrl(frame_id, url), ShutdownState::NotShuttingDown) => { + self.change_page_url(frame_id, url); } (Msg::PaintMsgDiscarded, ShutdownState::NotShuttingDown) => { @@ -441,8 +441,8 @@ impl IOCompositor { } } - fn change_page_load_data(&mut self, _: FrameId, load_data: LoadData) { - self.window.set_page_load_data(load_data); + fn change_page_url(&mut self, _: FrameId, url: Url) { + self.window.set_page_url(url); } fn all_pipelines_in_idle_paint_state(&self) -> bool { diff --git a/components/compositing/compositor_task.rs b/components/compositing/compositor_task.rs index e3c1a5102d1..9458c7fa150 100644 --- a/components/compositing/compositor_task.rs +++ b/components/compositing/compositor_task.rs @@ -20,8 +20,9 @@ use layers::layers::LayerBufferSet; use pipeline::CompositionPipeline; use msg::compositor_msg::{Epoch, LayerId, LayerMetadata, ReadyState}; use msg::compositor_msg::{PaintListener, PaintState, ScriptListener, ScrollPolicy}; -use msg::constellation_msg::{ConstellationChan, LoadData, PipelineId}; +use msg::constellation_msg::{ConstellationChan, PipelineId}; use msg::constellation_msg::{Key, KeyState, KeyModifiers}; +use url::Url; use util::cursor::Cursor; use util::geometry::PagePx; use util::memory::MemoryProfilerChan; @@ -200,8 +201,8 @@ pub enum Msg { ChangePaintState(PipelineId, PaintState), /// Alerts the compositor that the current page has changed its title. ChangePageTitle(PipelineId, Option), - /// Alerts the compositor that the current page has changed its load data (including URL). - ChangePageLoadData(FrameId, LoadData), + /// Alerts the compositor that the current page has changed its URL. + ChangePageUrl(FrameId, Url), /// Alerts the compositor that a `PaintMsg` has been discarded. PaintMsgDiscarded, /// Replaces the current frame tree, typically called during main frame navigation. @@ -237,7 +238,7 @@ impl Debug for Msg { Msg::ChangeReadyState(..) => write!(f, "ChangeReadyState"), Msg::ChangePaintState(..) => write!(f, "ChangePaintState"), Msg::ChangePageTitle(..) => write!(f, "ChangePageTitle"), - Msg::ChangePageLoadData(..) => write!(f, "ChangePageLoadData"), + Msg::ChangePageUrl(..) => write!(f, "ChangePageUrl"), Msg::PaintMsgDiscarded(..) => write!(f, "PaintMsgDiscarded"), Msg::SetFrameTree(..) => write!(f, "SetFrameTree"), Msg::CreateRootLayerForPipeline(..) => write!(f, "CreateRootLayerForPipeline"), diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 5ef72e185ec..aff40db788d 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -334,9 +334,9 @@ impl NavigationContext { /// compositor of the new URLs. fn set_current(&mut self, new_frame: Rc, compositor_proxy: &mut CompositorProxy) { self.current = Some(new_frame.clone()); - compositor_proxy.send(CompositorMsg::ChangePageLoadData( + compositor_proxy.send(CompositorMsg::ChangePageUrl( new_frame.id, - new_frame.pipeline.borrow().load_data.clone())); + new_frame.pipeline.borrow().url.clone())); } } @@ -762,7 +762,7 @@ impl Constellation { source Id of ScriptLoadedURLInIFrameMsg does have an associated pipeline in constellation. This should be impossible.").clone(); - let source_url = source_pipeline.load_data.url.clone(); + let source_url = source_pipeline.url.clone(); let same_script = (source_url.host() == url.host() && source_url.port() == url.port()) && diff --git a/components/compositing/headless.rs b/components/compositing/headless.rs index 0c38846d1d0..9957cb067cc 100644 --- a/components/compositing/headless.rs +++ b/components/compositing/headless.rs @@ -113,7 +113,7 @@ impl CompositorEventListener for NullCompositor { Msg::PaintMsgDiscarded(..) | Msg::ScrollTimeout(..) | Msg::ChangePageTitle(..) | - Msg::ChangePageLoadData(..) | + Msg::ChangePageUrl(..) | Msg::KeyEvent(..) | Msg::SetCursor(..) => {} Msg::PaintTaskExited(..) => {} diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index eabf93752b3..c09f4ea06d5 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -16,6 +16,7 @@ use msg::constellation_msg::{LoadData, WindowSizeData, PipelineExitType}; use net::image_cache_task::ImageCacheTask; use net::resource_task::ResourceTask; use net::storage_task::StorageTask; +use url::Url; use util::time::TimeProfilerChan; use std::rc::Rc; use std::sync::mpsc::{Receiver, channel}; @@ -29,8 +30,8 @@ pub struct Pipeline { pub paint_chan: PaintChan, pub layout_shutdown_port: Receiver<()>, pub paint_shutdown_port: Receiver<()>, - /// Load data corresponding to the most recently-loaded page. - pub load_data: LoadData, + /// URL corresponding to the most recently-loaded page. + pub url: Url, /// The title of the most recently-loaded page. pub title: Option, } @@ -137,7 +138,7 @@ impl Pipeline { paint_chan, layout_shutdown_port, paint_shutdown_port, - load_data) + load_data.url) } pub fn new(id: PipelineId, @@ -147,7 +148,7 @@ impl Pipeline { paint_chan: PaintChan, layout_shutdown_port: Receiver<()>, paint_shutdown_port: Receiver<()>, - load_data: LoadData) + url: Url) -> Pipeline { Pipeline { id: id, @@ -157,7 +158,7 @@ impl Pipeline { paint_chan: paint_chan, layout_shutdown_port: layout_shutdown_port, paint_shutdown_port: paint_shutdown_port, - load_data: load_data, + url: url, title: None, } } diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index 8c20aedd8e5..1990523dd2f 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -12,7 +12,8 @@ use geom::size::TypedSize2D; use layers::geometry::DevicePixel; use layers::platform::surface::NativeGraphicsMetadata; use msg::compositor_msg::{PaintState, ReadyState}; -use msg::constellation_msg::{Key, KeyState, KeyModifiers, LoadData}; +use msg::constellation_msg::{Key, KeyState, KeyModifiers}; +use url::Url; use util::cursor::Cursor; use util::geometry::ScreenPx; use std::fmt::{Error, Formatter, Debug}; @@ -105,7 +106,7 @@ pub trait WindowMethods { /// Sets the page title for the current page. fn set_page_title(&self, title: Option); /// Sets the load data for the current page. - fn set_page_load_data(&self, load_data: LoadData); + fn set_page_url(&self, url: Url); /// Called when the browser is done loading a frame. fn load_end(&self); diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index a52a5ec3191..d94dfcade90 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -389,6 +389,7 @@ dependencies = [ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "time 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", ] diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index c67a240d535..423e2be2246 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -392,6 +392,7 @@ dependencies = [ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "time 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", ] diff --git a/ports/cef/window.rs b/ports/cef/window.rs index 1b133e14d27..c485792005b 100644 --- a/ports/cef/window.rs +++ b/ports/cef/window.rs @@ -23,7 +23,7 @@ use layers::platform::surface::NativeGraphicsMetadata; use libc::{c_char, c_void}; use msg::constellation_msg::{Key, KeyModifiers}; use msg::compositor_msg::{ReadyState, PaintState}; -use msg::constellation_msg::LoadData; +use std_url::Url; use util::cursor::Cursor; use util::geometry::ScreenPx; use std::cell::RefCell; @@ -286,7 +286,7 @@ impl WindowMethods for Window { } } - fn set_page_load_data(&self, load_data: LoadData) { + fn set_page_url(&self, url: Url) { let browser = self.cef_browser.borrow(); let browser = match *browser { None => return, @@ -294,7 +294,7 @@ impl WindowMethods for Window { }; let frame = browser.get_main_frame(); let frame = frame.downcast(); - *frame.url.borrow_mut() = load_data.url.to_string() + *frame.url.borrow_mut() = url.to_string() } fn handle_key(&self, _: Key, _: KeyModifiers) { diff --git a/ports/glutin/Cargo.toml b/ports/glutin/Cargo.toml index d58ed4a32bd..7c3cb6f13d5 100644 --- a/ports/glutin/Cargo.toml +++ b/ports/glutin/Cargo.toml @@ -43,3 +43,4 @@ git = "https://github.com/servo/rust-egl" time = "0.1.12" bitflags = "*" libc = "*" +url = "*" \ No newline at end of file diff --git a/ports/glutin/lib.rs b/ports/glutin/lib.rs index b644483adb2..476ed457dea 100644 --- a/ports/glutin/lib.rs +++ b/ports/glutin/lib.rs @@ -22,6 +22,7 @@ extern crate msg; extern crate time; extern crate util; extern crate egl; +extern crate url; use compositing::windowing::WindowEvent; use geom::scale_factor::ScaleFactor; diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs index 2256d34b998..bf83b445e6a 100644 --- a/ports/glutin/window.rs +++ b/ports/glutin/window.rs @@ -15,10 +15,10 @@ use layers::platform::surface::NativeGraphicsMetadata; use msg::constellation_msg; use msg::constellation_msg::Key; use msg::compositor_msg::{PaintState, ReadyState}; -use msg::constellation_msg::LoadData; use NestedEventLoopListener; use std::rc::Rc; use std::sync::mpsc::{channel, Sender}; +use url::Url; use util::cursor::Cursor; use util::geometry::ScreenPx; @@ -462,7 +462,7 @@ impl WindowMethods for Window { self.window.set_title(&title); } - fn set_page_load_data(&self, _: LoadData) { + fn set_page_url(&self, _: Url) { } fn load_end(&self) { @@ -657,7 +657,7 @@ impl WindowMethods for Window { fn set_page_title(&self, _: Option) { } - fn set_page_load_data(&self, _: LoadData) { + fn set_page_url(&self, _: Url) { } fn load_end(&self) { diff --git a/ports/gonk/src/window.rs b/ports/gonk/src/window.rs index 818e62c6835..0e8bf8451a1 100644 --- a/ports/gonk/src/window.rs +++ b/ports/gonk/src/window.rs @@ -13,7 +13,6 @@ use layers::platform::surface::NativeGraphicsMetadata; use libc::c_int; use msg::compositor_msg::{ReadyState, PaintState}; use msg::constellation_msg::{Key, KeyModifiers}; -use msg::constellation_msg::LoadData; use std::cell::Cell; use std::sync::mpsc::{channel, Sender, Receiver}; use std::rc::Rc; @@ -22,6 +21,7 @@ use std::mem::size_of; use std::mem::zeroed; use std::ptr; use std::ffi::CString; +use url::Url; use util::cursor::Cursor; use util::geometry::ScreenPx; use gleam::gl; @@ -804,7 +804,7 @@ impl WindowMethods for Window { fn set_page_title(&self, _: Option) { } - fn set_page_load_data(&self, _: LoadData) { + fn set_page_url(&self, _: Url) { } fn load_end(&self) {