diff options
-rw-r--r-- | components/compositing/compositor.rs | 12 | ||||
-rw-r--r-- | components/constellation/constellation.rs | 14 | ||||
-rw-r--r-- | components/script_traits/lib.rs | 3 | ||||
-rw-r--r-- | components/servo/lib.rs | 4 | ||||
-rw-r--r-- | ports/cef/browser.rs | 13 | ||||
-rw-r--r-- | ports/cef/frame.rs | 13 | ||||
-rw-r--r-- | ports/cef/window.rs | 5 |
7 files changed, 5 insertions, 59 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 666952d1240..337bf23a411 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -463,7 +463,6 @@ impl<Window: WindowMethods> IOCompositor<Window> { ShutdownState::NotShuttingDown) => { self.set_frame_tree(&frame_tree); self.send_viewport_rects(); - self.title_for_main_frame(); } (Msg::ScrollFragmentPoint(scroll_root_id, point, _), @@ -1659,17 +1658,6 @@ impl<Window: WindowMethods> IOCompositor<Window> { // TODO(gw): Access via WR. 1.0 } - - pub fn title_for_main_frame(&self) { - let root_pipeline_id = match self.root_pipeline { - None => return, - Some(ref root_pipeline) => root_pipeline.id, - }; - let msg = ConstellationMsg::GetPipelineTitle(root_pipeline_id); - if let Err(e) = self.constellation_chan.send(msg) { - warn!("Failed to send pipeline title ({}).", e); - } - } } diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 17912603e01..271db06fa01 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -919,10 +919,6 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> .map(|pipeline| pipeline.top_level_browsing_context_id); let _ = resp_chan.send(focus_browsing_context); } - FromCompositorMsg::GetPipelineTitle(pipeline_id) => { - debug!("constellation got get-pipeline-title message"); - self.handle_get_pipeline_title_msg(pipeline_id); - } FromCompositorMsg::KeyEvent(ch, key, state, modifiers) => { debug!("constellation got key event message"); self.handle_key_msg(ch, key, state, modifiers); @@ -1916,16 +1912,6 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> } } - fn handle_get_pipeline_title_msg(&mut self, pipeline_id: PipelineId) { - let result = match self.pipelines.get(&pipeline_id) { - None => return self.compositor_proxy.send(ToCompositorMsg::ChangePageTitle(pipeline_id, None)), - Some(pipeline) => pipeline.event_loop.send(ConstellationControlMsg::GetTitle(pipeline_id)), - }; - if let Err(e) = result { - self.handle_send_error(pipeline_id, e); - } - } - fn handle_post_message_msg(&mut self, browsing_context_id: BrowsingContextId, origin: Option<ImmutableOrigin>, diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 85189c29229..1a3ec8c7a6c 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -747,9 +747,6 @@ pub enum ConstellationMsg { /// Request that the constellation send the current focused top-level browsing context id, /// over a provided channel. GetFocusTopLevelBrowsingContext(IpcSender<Option<TopLevelBrowsingContextId>>), - /// Requests that the constellation inform the compositor of the title of the pipeline - /// immediately. - GetPipelineTitle(PipelineId), /// Request to load the initial page. InitLoadUrl(ServoUrl), /// Query the constellation to see if the current compositor output is stable diff --git a/components/servo/lib.rs b/components/servo/lib.rs index f480e9157e9..25a2891046b 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -252,10 +252,6 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static { self.compositor.pinch_zoom_level() } - pub fn request_title_for_main_frame(&self) { - self.compositor.title_for_main_frame() - } - pub fn setup_logging(&self) { let constellation_chan = self.constellation_chan.clone(); log::set_logger(|max_log_level| { diff --git a/ports/cef/browser.rs b/ports/cef/browser.rs index b606095a7fb..10724a2333b 100644 --- a/ports/cef/browser.rs +++ b/ports/cef/browser.rs @@ -41,14 +41,6 @@ impl ServoBrowser { } } - pub fn request_title_for_main_frame(&self) { - match *self { - ServoBrowser::OnScreen(ref browser) => browser.request_title_for_main_frame(), - ServoBrowser::OffScreen(ref browser) => browser.request_title_for_main_frame(), - ServoBrowser::Invalid => {} - } - } - pub fn pinch_zoom_level(&self) -> f32 { match *self { ServoBrowser::OnScreen(ref browser) => browser.pinch_zoom_level(), @@ -163,7 +155,6 @@ impl ServoCefBrowser { pub trait ServoCefBrowserExtensions { fn init(&self, window_info: &cef_window_info_t); fn send_window_event(&self, event: WindowEvent); - fn request_title_for_main_frame(&self); fn pinch_zoom_level(&self) -> f32; } @@ -200,10 +191,6 @@ impl ServoCefBrowserExtensions for CefBrowser { } } - fn request_title_for_main_frame(&self) { - self.downcast().servo_browser.borrow().request_title_for_main_frame() - } - fn pinch_zoom_level(&self) -> f32 { self.downcast().servo_browser.borrow().pinch_zoom_level() } diff --git a/ports/cef/frame.rs b/ports/cef/frame.rs index 9dd42676f39..82f72e627cc 100644 --- a/ports/cef/frame.rs +++ b/ports/cef/frame.rs @@ -11,8 +11,8 @@ use compositing::windowing::WindowEvent; use std::cell::RefCell; pub struct ServoCefFrame { - pub title_visitor: RefCell<Option<CefStringVisitor>>, pub url: RefCell<String>, + pub title: RefCell<Vec<u16>>, /// A reference to the browser. pub browser: RefCell<Option<CefBrowser>>, @@ -21,8 +21,8 @@ pub struct ServoCefFrame { impl ServoCefFrame { pub fn new() -> ServoCefFrame { ServoCefFrame { - title_visitor: RefCell::new(None), url: RefCell::new(String::new()), + title: RefCell::new(vec![]), browser: RefCell::new(None), } } @@ -44,15 +44,14 @@ full_cef_class_impl! { }} fn get_text(&this, visitor: *mut cef_string_visitor_t [CefStringVisitor],) -> () {{ let this = this.downcast(); - *this.title_visitor.borrow_mut() = Some(visitor); - this.browser.borrow().as_ref().unwrap().request_title_for_main_frame(); + let str = &*this.title.borrow(); + visitor.visit(str) }} } } pub trait ServoCefFrameExtensions { fn set_browser(&self, browser: CefBrowser); - fn set_url(&self, url: &[u16]); fn load(&self); } @@ -60,10 +59,6 @@ impl ServoCefFrameExtensions for CefFrame { fn set_browser(&self, browser: CefBrowser) { *self.downcast().browser.borrow_mut() = Some(browser) } - fn set_url(&self, url: &[u16]) { - let frame = self.downcast(); - *frame.url.borrow_mut() = String::from_utf16(url).unwrap(); - } fn load(&self) { let event = WindowEvent::LoadUrl(self.downcast().url.borrow().clone()); self.downcast().browser.borrow_mut().as_mut().unwrap().send_window_event(event); diff --git a/ports/cef/window.rs b/ports/cef/window.rs index 03fd784fbd0..4f4837e0a41 100644 --- a/ports/cef/window.rs +++ b/ports/cef/window.rs @@ -433,7 +433,6 @@ impl WindowMethods for Window { }; let frame = browser.get_main_frame(); let frame = frame.downcast(); - let mut title_visitor = frame.title_visitor.borrow_mut(); let str = match string { Some(s) => s.encode_utf16().collect(), None => vec![] @@ -444,9 +443,7 @@ impl WindowMethods for Window { browser.get_host().get_client().get_display_handler().on_title_change((*browser).clone(), str.as_slice()); } - if let Some(ref mut visitor) = *title_visitor { - visitor.visit(&str); - } + *frame.title.borrow_mut() = str; } fn history_changed(&self, history: Vec<LoadData>, current: usize) { |