Skip to content

Commit

Permalink
Responding to review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Jeffrey committed Jun 6, 2017
1 parent 66f61ea commit 8047f6a
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions components/constellation/constellation.rs
Expand Up @@ -1178,13 +1178,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
self.mem_profiler_chan.send(mem::ProfilerMsg::Exit);

// Close the top-level browsing contexts
let top_level_browsing_context_ids: Vec<TopLevelBrowsingContextId> = self.browsing_contexts.values()
let browsing_context_ids: Vec<BrowsingContextId> = self.browsing_contexts.values()
.filter(|browsing_context| browsing_context.is_top_level())
.map(|browsing_context| browsing_context.top_level_id)
.map(|browsing_context| browsing_context.id)
.collect();
for top_level_browsing_context_id in top_level_browsing_context_ids {
debug!("Removing top-level browsing context {}.", top_level_browsing_context_id);
let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id);
for browsing_context_id in browsing_context_ids {
debug!("Removing top-level browsing context {}.", browsing_context_id);
self.close_browsing_context(browsing_context_id, ExitPipelineMode::Normal);
}

Expand Down Expand Up @@ -1657,13 +1656,6 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
return None;
}
};
let (top_level_id, window_size, timestamp) = match self.browsing_contexts.get(&browsing_context_id) {
Some(browsing_context) => (browsing_context.top_level_id, browsing_context.size, browsing_context.instant),
None => {
warn!("Browsing context {} loaded after closure.", browsing_context_id);
return None;
}
};
match parent_info {
Some((parent_pipeline_id, _)) => {
// Find the script thread for the pipeline containing the iframe
Expand Down Expand Up @@ -1705,6 +1697,13 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
// changes would be overridden by changing the subframe associated with source_id.

// Create the new pipeline
let (top_level_id, window_size, timestamp) = match self.browsing_contexts.get(&browsing_context_id) {
Some(context) => (context.top_level_id, context.size, context.instant),
None => {
warn!("Browsing context {} loaded after closure.", browsing_context_id);
return None;
}
};
let new_pipeline_id = PipelineId::new();
let sandbox = IFrameSandboxState::IFrameUnsandboxed;
let replace_instant = if replace { Some(timestamp) } else { None };
Expand Down

0 comments on commit 8047f6a

Please sign in to comment.