aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/history.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-08-15 02:20:10 -0500
committerGitHub <noreply@github.com>2017-08-15 02:20:10 -0500
commit74558990b258cb55f230ebe8ec3fc557fd286f94 (patch)
tree69fcdcf92cca98dad2710d15dd7979b0f4079117 /components/script/dom/history.rs
parentfff50acd8188865c50a12ba6f623d14f94761919 (diff)
parent10b52669d7dbe0f7d538bbd51135b66ad9488890 (diff)
downloadservo-74558990b258cb55f230ebe8ec3fc557fd286f94.tar.gz
servo-74558990b258cb55f230ebe8ec3fc557fd286f94.zip
Auto merge of #17425 - paulrouget:attach-pipeline-2, r=asajeffrey
cleanup embedder/compositor/constellation/script messages Fix: #17226 #17200 #17201 This is work in progress. Some tests still fail. I'd like to get early feedback as it's a pretty large PR. There is nothing fundamentally new. Basically, I added TopLevelBrowsingContrextId to the relevant messages between the embedder, the compositor and the constellation, and enforced the PipelineId to be attached to each ScriptMsg (see #17201). I unaliased all the ScriptMsg. It was getting difficult to understand the nature of the message as ScriptMsg was used aliased CompositorMsg sometimes (CompositorMsg is an actually type of message already). I renamed constellation_chan to script_to_constellation_chan, again, for clarification. This cleanup code is necessary for #15934 and for tabs support. /cc @asajeffrey can I ask you to look at this? No need for a formal review, I need feedback at this stage. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17425) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/history.rs')
-rw-r--r--components/script/dom/history.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/components/script/dom/history.rs b/components/script/dom/history.rs
index b9601d2ca1c..9344f3f4b80 100644
--- a/components/script/dom/history.rs
+++ b/components/script/dom/history.rs
@@ -15,7 +15,7 @@ use dom::window::Window;
use dom_struct::dom_struct;
use ipc_channel::ipc;
use msg::constellation_msg::TraversalDirection;
-use script_traits::ScriptMsg as ConstellationMsg;
+use script_traits::ScriptMsg;
// https://html.spec.whatwg.org/multipage/#the-history-interface
#[dom_struct]
@@ -44,9 +44,8 @@ impl History {
if !self.window.Document().is_fully_active() {
return Err(Error::Security);
}
- let top_level_browsing_context_id = self.window.window_proxy().top_level_browsing_context_id();
- let msg = ConstellationMsg::TraverseHistory(top_level_browsing_context_id, direction);
- let _ = self.window.upcast::<GlobalScope>().constellation_chan().send(msg);
+ let msg = ScriptMsg::TraverseHistory(direction);
+ let _ = self.window.upcast::<GlobalScope>().script_to_constellation_chan().send(msg);
Ok(())
}
}
@@ -57,10 +56,9 @@ impl HistoryMethods for History {
if !self.window.Document().is_fully_active() {
return Err(Error::Security);
}
- let top_level_browsing_context_id = self.window.window_proxy().top_level_browsing_context_id();
let (sender, recv) = ipc::channel().expect("Failed to create channel to send jsh length.");
- let msg = ConstellationMsg::JointSessionHistoryLength(top_level_browsing_context_id, sender);
- let _ = self.window.upcast::<GlobalScope>().constellation_chan().send(msg);
+ let msg = ScriptMsg::JointSessionHistoryLength(sender);
+ let _ = self.window.upcast::<GlobalScope>().script_to_constellation_chan().send(msg);
Ok(recv.recv().unwrap())
}