Repository navigation
Closed
Labels
Description
DissimilarOriginWindows create a new GlobalScope with a phony PipelineId. Messages sent to the constellation from script are required to send a source PipelineId. Messages sent with the phony PipelineId will not be processed by the constellation because the Pipeline lookup will fail.
servo/components/constellation/constellation.rs
Lines 1019 to 1024 in bfb9fe6
| let (source_pipeline_id, content) = message; | |
| let source_top_ctx_id = match self.pipelines.get(&source_pipeline_id) | |
| .map(|pipeline| pipeline.top_level_browsing_context_id) { | |
| None => return warn!("ScriptMsg from closed pipeline {:?}.", source_pipeline_id), | |
| Some(ctx) => ctx, | |
| }; |
Also the script to constellation channel is storing the wrong PipelineId:
| global_to_clone_from.script_to_constellation_chan().clone(), |
servo/components/script_traits/lib.rs
Lines 789 to 803 in bfb9fe6
| /// A Script to Constellation channel. | |
| #[derive(Clone, Deserialize, Serialize)] | |
| pub struct ScriptToConstellationChan { | |
| /// Sender for communicating with constellation thread. | |
| pub sender: IpcSender<(PipelineId, ScriptMsg)>, | |
| /// Used to identify the origin of the message. | |
| pub pipeline_id: PipelineId, | |
| } | |
| impl ScriptToConstellationChan { | |
| /// Send ScriptMsg and attach the pipeline_id to the message. | |
| pub fn send(&self, msg: ScriptMsg) -> Result<(), IpcError> { | |
| self.sender.send((self.pipeline_id, msg)) | |
| } | |
| } |
cc @asajeffrey
Activity
asajeffrey commentedon Apr 10, 2018
IRC chat: https://mozilla.logbot.info/servo/20180410#c14586192 (and for bonus points, go back and watch me flail around trying to debug this).
asajeffrey commentedon Apr 10, 2018
One thing we could do is only put the pipeline id into messages that need it, and stop having ScriptToConstellationChan storing a pipeline id.
Auto merge of #20614 - asajeffrey:script-dissimilar-orgin-postMessage…