Auto merge of #8530 - KiChjang:split-constellation-msg, r=jdm

Split ConstellationMsg into ScriptMsg and CompositorMsg

Fixes #8356.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8530)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-11-19 04:39:20 +05:30
commit acbe413052
29 changed files with 259 additions and 210 deletions

View file

@ -8,7 +8,8 @@ use clock_ticks;
use flow::{self, Flow};
use gfx::display_list::OpaqueNode;
use incremental::{self, RestyleDamage};
use msg::constellation_msg::{AnimationState, ConstellationChan, Msg, PipelineId};
use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{AnimationState, ConstellationChan, PipelineId};
use script::layout_interface::Animation;
use std::collections::HashMap;
use std::collections::hash_map::Entry;
@ -48,7 +49,7 @@ pub fn start_transitions_if_applicable(new_animations_sender: &Mutex<Sender<Anim
/// Processes any new animations that were discovered after style recalculation.
/// Also expire any old animations that have completed.
pub fn update_animation_state(constellation_chan: &ConstellationChan,
pub fn update_animation_state(constellation_chan: &ConstellationChan<ConstellationMsg>,
running_animations: &mut Arc<HashMap<OpaqueNode, Vec<Animation>>>,
new_animations_receiver: &Receiver<Animation>,
pipeline_id: PipelineId) {
@ -100,7 +101,7 @@ pub fn update_animation_state(constellation_chan: &ConstellationChan,
}
constellation_chan.0
.send(Msg::ChangeRunningAnimationsState(pipeline_id, animation_state))
.send(ConstellationMsg::ChangeRunningAnimationsState(pipeline_id, animation_state))
.unwrap();
}

View file

@ -37,7 +37,7 @@ use layout_debug;
use layout_traits::LayoutTaskFactory;
use log;
use msg::compositor_msg::{Epoch, LayerId, ScrollPolicy};
use msg::constellation_msg::Msg as ConstellationMsg;
use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId};
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheResult, ImageCacheTask};
use opaque_node::OpaqueNodeMethods;
@ -95,7 +95,7 @@ const DISPLAY_PORT_THRESHOLD_SIZE_FACTOR: i32 = 4;
/// This needs to be protected by a mutex so we can do fast RPCs.
pub struct LayoutTaskData {
/// The channel on which messages can be sent to the constellation.
pub constellation_chan: ConstellationChan,
pub constellation_chan: ConstellationChan<ConstellationMsg>,
/// The root stacking context.
pub stacking_context: Option<Arc<StackingContext>>,
@ -149,7 +149,7 @@ pub struct LayoutTask {
font_cache_sender: Sender<()>,
/// The channel on which messages can be sent to the constellation.
constellation_chan: ConstellationChan,
constellation_chan: ConstellationChan<ConstellationMsg>,
/// The channel on which messages can be sent to the script task.
script_chan: Sender<ConstellationControlMsg>,
@ -226,7 +226,7 @@ impl LayoutTaskFactory for LayoutTask {
is_iframe: bool,
chan: OpaqueScriptLayoutChannel,
pipeline_port: IpcReceiver<LayoutControlMsg>,
constellation_chan: ConstellationChan,
constellation_chan: ConstellationChan<ConstellationMsg>,
failure_msg: Failure,
script_chan: Sender<ConstellationControlMsg>,
paint_chan: OptionalIpcSender<LayoutToPaintMsg>,
@ -354,7 +354,7 @@ impl LayoutTask {
is_iframe: bool,
port: Receiver<Msg>,
pipeline_port: IpcReceiver<LayoutControlMsg>,
constellation_chan: ConstellationChan,
constellation_chan: ConstellationChan<ConstellationMsg>,
script_chan: Sender<ConstellationControlMsg>,
paint_chan: OptionalIpcSender<LayoutToPaintMsg>,
image_cache_task: ImageCacheTask,

View file

@ -12,7 +12,7 @@ use fragment::{Fragment, FragmentBorderBoxIterator};
use gfx::display_list::{DisplayItemMetadata, OpaqueNode};
use layout_task::LayoutTaskData;
use msg::constellation_msg::ConstellationChan;
use msg::constellation_msg::Msg as ConstellationMsg;
use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use opaque_node::OpaqueNodeMethods;
use script::layout_interface::{ContentBoxResponse, ContentBoxesResponse, NodeGeometryResponse};
use script::layout_interface::{HitTestResponse, LayoutRPC, MouseOverResponse, OffsetParentResponse};