Skip to content

DissimilarOriginWindows do not send messages with real pipeline ids to the constellation #20604

Closed

Description

@cbrewster

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.

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(),

/// 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

  1. added
    A-content/script
    A-constellation
    on Apr 10, 2018
  2. asajeffrey commented on Apr 10, 2018

    @asajeffrey
    Contributor

    IRC chat: https://mozilla.logbot.info/servo/20180410#c14586192 (and for bonus points, go back and watch me flail around trying to debug this).

  3. asajeffrey commented on Apr 10, 2018

    @asajeffrey
    Contributor

    One thing we could do is only put the pipeline id into messages that need it, and stop having ScriptToConstellationChan storing a pipeline id.

  4. added a commit that references this issue on Apr 10, 2018
    cba8b08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-constellationA-content/script

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions