Move FailureMsg contents into a cloneable struct

This commit is contained in:
Keegan McAllister 2013-12-12 16:29:14 -08:00
parent e7aa445e52
commit 73e2e57535
2 changed files with 10 additions and 3 deletions

View file

@ -10,7 +10,7 @@ use geom::size::Size2D;
use gfx::opts::Opts;
use pipeline::{Pipeline, CompositionPipeline};
use script::script_task::{ResizeMsg, ResizeInactiveMsg};
use servo_msg::constellation_msg::{ConstellationChan, ExitMsg, FailureMsg, FrameRectMsg};
use servo_msg::constellation_msg::{ConstellationChan, ExitMsg, FailureMsg, Failure, FrameRectMsg};
use servo_msg::constellation_msg::{IFrameSandboxState, IFrameUnsandboxed, InitLoadUrlMsg};
use servo_msg::constellation_msg::{LoadCompleteMsg, LoadIframeUrlMsg, LoadUrlMsg, Msg, NavigateMsg};
use servo_msg::constellation_msg::{NavigationType, PipelineId, RendererReadyMsg, ResizedWindowMsg};
@ -321,7 +321,7 @@ impl Constellation {
self.handle_exit();
return false;
}
FailureMsg(pipeline_id, subpage_id) => {
FailureMsg(Failure { pipeline_id, subpage_id }) => {
self.handle_failure_msg(pipeline_id, subpage_id);
}
// This should only be called once per constellation, and only by the browser

View file

@ -26,10 +26,17 @@ pub enum IFrameSandboxState {
IFrameUnsandboxed
}
// We pass this info to various tasks, so it lives in a separate, cloneable struct.
#[deriving(Clone)]
pub struct Failure {
pipeline_id: PipelineId,
subpage_id: Option<SubpageId>,
}
/// Messages from the compositor and script to the constellation.
pub enum Msg {
ExitMsg,
FailureMsg(PipelineId, Option<SubpageId>),
FailureMsg(Failure),
InitLoadUrlMsg(Url),
LoadCompleteMsg(PipelineId, Url),
FrameRectMsg(PipelineId, SubpageId, Rect<f32>),