diff options
author | Keegan McAllister <kmcallister@mozilla.com> | 2013-12-12 16:29:14 -0800 |
---|---|---|
committer | Keegan McAllister <kmcallister@mozilla.com> | 2014-02-12 18:07:32 -0800 |
commit | 73e2e57535cc78b14207d4f0426ad5a53ab1f10f (patch) | |
tree | da9e56a1ab02eafa81464e7babc4749198599309 | |
parent | e7aa445e520e7daa504ae1bec1fe1f262dbd1b9e (diff) | |
download | servo-73e2e57535cc78b14207d4f0426ad5a53ab1f10f.tar.gz servo-73e2e57535cc78b14207d4f0426ad5a53ab1f10f.zip |
Move FailureMsg contents into a cloneable struct
-rw-r--r-- | src/components/main/constellation.rs | 4 | ||||
-rw-r--r-- | src/components/msg/constellation_msg.rs | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/components/main/constellation.rs b/src/components/main/constellation.rs index 3c490894592..7a6730c6507 100644 --- a/src/components/main/constellation.rs +++ b/src/components/main/constellation.rs @@ -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 diff --git a/src/components/msg/constellation_msg.rs b/src/components/msg/constellation_msg.rs index 74c2c282d6f..9d3c1540066 100644 --- a/src/components/msg/constellation_msg.rs +++ b/src/components/msg/constellation_msg.rs @@ -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>), |