Implement browsing context discarding.

This commit is contained in:
Alan Jeffrey 2016-11-30 16:54:12 -06:00
parent 143dfc879e
commit 7c2de62124
12 changed files with 196 additions and 160 deletions

View file

@ -184,6 +184,15 @@ pub struct NewLayoutInfo {
pub layout_threads: usize,
}
/// When a pipeline is closed, should its browsing context be discarded too?
#[derive(Copy, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
pub enum DiscardBrowsingContext {
/// Discard the browsing context
Yes,
/// Don't discard the browsing context
No,
}
/// Messages sent from the constellation or layout to the script thread.
#[derive(Deserialize, Serialize)]
pub enum ConstellationControlMsg {
@ -194,7 +203,7 @@ pub enum ConstellationControlMsg {
/// Notifies script that window has been resized but to not take immediate action.
ResizeInactive(PipelineId, WindowSizeData),
/// Notifies the script that a pipeline should be closed.
ExitPipeline(PipelineId),
ExitPipeline(PipelineId, DiscardBrowsingContext),
/// Notifies the script that the whole thread should be closed.
ExitScriptThread,
/// Sends a DOM event.

View file

@ -102,7 +102,8 @@ pub enum ScriptMsg {
/// Status message to be displayed in the chrome, eg. a link URL on mouseover.
NodeStatus(Option<String>),
/// Notification that this iframe should be removed.
RemoveIFrame(PipelineId, Option<IpcSender<()>>),
/// Returns a list of pipelines which were closed.
RemoveIFrame(FrameId, IpcSender<Vec<PipelineId>>),
/// Change pipeline visibility
SetVisible(PipelineId, bool),
/// Notifies constellation that an iframe's visibility has been changed.