Make it possible for iframes to create their own pipeline ID.

This doesn't change any functionality, but it's the first step towards removing SubpageId.

Adding this change now will allow us to gradually change over code referencing subpage id rather than in one massive PR.

Introduces a namespace for pipeline ID generation - there is a namespace for the constellation thread, and one per script thread.
This commit is contained in:
Glenn Watson 2015-10-01 08:53:36 +10:00
parent 35888e5a1d
commit 5645dba1fa
9 changed files with 193 additions and 68 deletions

View file

@ -16,6 +16,7 @@ use layers::geometry::DevicePixel;
use layout_traits::{LayoutControlChan, LayoutTaskFactory};
use msg::constellation_msg::{ConstellationChan, Failure, FrameId, PipelineId, SubpageId};
use msg::constellation_msg::{LoadData, MozBrowserEvent, PipelineExitType, WindowSizeData};
use msg::constellation_msg::{PipelineNamespaceId};
use net_traits::ResourceTask;
use net_traits::image_cache_task::ImageCacheTask;
use net_traits::storage_task::StorageTask;
@ -99,6 +100,8 @@ pub struct InitialPipelineState {
pub script_chan: Option<Sender<ConstellationControlMsg>>,
/// Information about the page to load.
pub load_data: LoadData,
/// The ID of the pipeline namespace for this script thread.
pub pipeline_namespace_id: PipelineNamespaceId,
}
impl Pipeline {
@ -198,6 +201,7 @@ impl Pipeline {
pipeline_port: pipeline_port,
paint_shutdown_chan: paint_shutdown_chan,
layout_shutdown_chan: layout_shutdown_chan,
pipeline_namespace_id: state.pipeline_namespace_id,
};
(pipeline, pipeline_content)
@ -332,6 +336,7 @@ pub struct PipelineContent {
paint_shutdown_chan: Sender<()>,
pipeline_port: Option<IpcReceiver<LayoutControlMsg>>,
layout_shutdown_chan: Sender<()>,
pipeline_namespace_id: PipelineNamespaceId,
}
impl PipelineContent {
@ -364,6 +369,7 @@ impl PipelineContent {
mem_profiler_chan: self.mem_profiler_chan.clone(),
devtools_chan: self.devtools_chan,
window_size: self.window_size,
pipeline_namespace_id: self.pipeline_namespace_id,
}, &layout_pair, self.load_data.clone());
LayoutTaskFactory::create(None::<&mut LTF>,