Move tinyfiledialog out of script into embedder.

This commit is contained in:
gatowololo 2019-06-26 14:44:44 -07:00 committed by Iulian Gabriel Radu
parent 24c14ac94e
commit 675b36dde5
6 changed files with 81 additions and 45 deletions

View file

@ -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
}