aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/globalscope.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/globalscope.rs')
-rw-r--r--components/script/dom/globalscope.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs
index e631c9bfc9c..f46a07bbcb2 100644
--- a/components/script/dom/globalscope.rs
+++ b/components/script/dom/globalscope.rs
@@ -61,6 +61,7 @@ use crate::timers::{OneshotTimers, TimerCallback};
use content_security_policy::CspList;
use devtools_traits::{PageError, ScriptToDevtoolsControlMsg};
use dom_struct::dom_struct;
+use embedder_traits::EmbedderMsg;
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER;
use js::glue::{IsWrapper, UnwrapObjectDynamic};
@@ -1917,6 +1918,14 @@ impl GlobalScope {
&self.script_to_constellation_chan
}
+ pub fn send_to_embedder(&self, msg: EmbedderMsg) {
+ self.send_to_constellation(ScriptMsg::ForwardToEmbedder(msg));
+ }
+
+ pub fn send_to_constellation(&self, msg: ScriptMsg) {
+ self.script_to_constellation_chan().send(msg).unwrap();
+ }
+
pub fn scheduler_chan(&self) -> &IpcSender<TimerSchedulerMsg> {
&self.scheduler_chan
}