diff options
author | Gregory Terzian <gterzian@users.noreply.github.com> | 2018-04-28 22:48:14 +0800 |
---|---|---|
committer | Gregory Terzian <gterzian@users.noreply.github.com> | 2018-05-23 21:45:57 +0800 |
commit | d4382407722108a52bf23b1f3a3114984f13fb90 (patch) | |
tree | 55f5dad9ccad14e6911cb5434f2d362ba79f166e /components/script/script_thread.rs | |
parent | a297e8f2881d0d1927160d2ebc0e4b26d71f2534 (diff) | |
download | servo-d4382407722108a52bf23b1f3a3114984f13fb90.tar.gz servo-d4382407722108a52bf23b1f3a3114984f13fb90.zip |
move msg to embedder_traits, use in script, handle send error in embedder
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 613918f6a76..a118562a234 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -62,6 +62,7 @@ use dom::windowproxy::WindowProxy; use dom::worker::TrustedWorkerAddress; use dom::worklet::WorkletThreadPool; use dom::workletglobalscope::WorkletGlobalScopeInit; +use embedder_traits::EmbedderMsg; use euclid::{Point2D, Vector2D, Rect}; use fetch::FetchCanceller; use hyper::header::{ContentType, HttpDate, Headers, LastModified}; @@ -1822,7 +1823,7 @@ impl ScriptThread { Some(document) => document, None => return warn!("Message sent to closed pipeline {}.", pipeline_id), }; - document.send_title_to_constellation(); + document.send_title_to_embedder(); } /// Handles a request to exit a pipeline and shut down layout. @@ -2282,6 +2283,8 @@ impl ScriptThread { Some(document) => document, None => return warn!("Message sent to closed pipeline {}.", pipeline_id), }; + let window = document.window(); + let top_level_browsing_context_id = window.top_level_browsing_context_id(); // Get the previous target temporarily let prev_mouse_over_target = self.topmost_mouse_over_target.get(); @@ -2310,9 +2313,8 @@ impl ScriptThread { let url = document.url(); url.join(&value).map(|url| url.to_string()).ok() }); - - let event = ScriptMsg::NodeStatus(status); - self.script_sender.send((pipeline_id, event)).unwrap(); + let event = EmbedderMsg::Status(top_level_browsing_context_id, status); + window.send_to_embedder(event); state_already_changed = true; } @@ -2325,8 +2327,8 @@ impl ScriptThread { .inclusive_ancestors() .filter_map(DomRoot::downcast::<HTMLAnchorElement>) .next() { - let event = ScriptMsg::NodeStatus(None); - self.script_sender.send((pipeline_id, event)).unwrap(); + let event = EmbedderMsg::Status(top_level_browsing_context_id, None); + window.send_to_embedder(event); } } } |