Auto merge of #11430 - asajeffrey:constellation-record-mozbrowser-parent-info, r=ConnorGBrewster

Record the frame type (IFrame or MozBrowserIFrame) in the pipeline.

Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data:
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because this is a refactoring

Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process.

This is a first step towards supporting the notion of multiple top-level browsing contexts in Servo, by making the constellation aware of which content is loaded in a mozbrowser iframe.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11430)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-26 14:53:09 -05:00
commit 64cca225e5
6 changed files with 66 additions and 55 deletions

View file

@ -14,7 +14,7 @@ use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use layers::geometry::DevicePixel;
use layout_traits::{LayoutControlChan, LayoutThreadFactory};
use msg::constellation_msg::{FrameId, LoadData, PanicMsg, PipelineId};
use msg::constellation_msg::{FrameId, FrameType, LoadData, PanicMsg, PipelineId};
use msg::constellation_msg::{PipelineNamespaceId, SubpageId, WindowSizeData};
use net_traits::ResourceThreads;
use net_traits::bluetooth_thread::BluetoothMethodMsg;
@ -38,7 +38,7 @@ use webrender_traits;
/// A uniquely-identifiable pipeline of script thread, layout thread, and paint thread.
pub struct Pipeline {
pub id: PipelineId,
pub parent_info: Option<(PipelineId, SubpageId)>,
pub parent_info: Option<(PipelineId, SubpageId, FrameType)>,
pub script_chan: IpcSender<ConstellationControlMsg>,
/// A channel to layout, for performing reflows and shutdown.
pub layout_chan: LayoutControlChan,
@ -68,7 +68,7 @@ pub struct InitialPipelineState {
pub id: PipelineId,
/// The subpage ID of this pipeline to create in its pipeline parent.
/// If `None`, this is the root.
pub parent_info: Option<(PipelineId, SubpageId)>,
pub parent_info: Option<(PipelineId, SubpageId, FrameType)>,
/// A channel to the associated constellation.
pub constellation_chan: IpcSender<ScriptMsg>,
/// A channel for the layout thread to send messages to the constellation.
@ -156,7 +156,7 @@ impl Pipeline {
let (script_chan, script_port, pipeline_port) = match state.script_chan {
Some(script_chan) => {
let (containing_pipeline_id, subpage_id) =
let (containing_pipeline_id, subpage_id, _) =
state.parent_info.expect("script_pipeline != None but subpage_id == None");
let new_layout_info = NewLayoutInfo {
containing_pipeline_id: containing_pipeline_id,
@ -198,7 +198,7 @@ impl Pipeline {
let unprivileged_pipeline_content = UnprivilegedPipelineContent {
id: state.id,
parent_info: state.parent_info,
parent_info: state.parent_info.map(|(parent_id, subpage_id, _)| (parent_id, subpage_id)),
constellation_chan: state.constellation_chan,
scheduler_chan: state.scheduler_chan,
devtools_chan: script_to_devtools_chan,
@ -246,7 +246,7 @@ impl Pipeline {
}
pub fn new(id: PipelineId,
parent_info: Option<(PipelineId, SubpageId)>,
parent_info: Option<(PipelineId, SubpageId, FrameType)>,
script_chan: IpcSender<ConstellationControlMsg>,
layout_chan: LayoutControlChan,
compositor_proxy: Box<CompositorProxy + 'static + Send>,