servo: Merge #7807 - Make it possible for iframes to create their own pipeline ID (from glennw:pid); r=jdm

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.

Source-Repo: https://github.com/servo/servo
Source-Revision: 098bdb5f22500a6e856b085a1140090f63ef8645
This commit is contained in:
Glenn Watson
2015-10-06 01:08:32 -06:00
parent ebde0a093d
commit 346d7ca09a
9 changed files with 193 additions and 68 deletions

View File

@@ -66,6 +66,7 @@ use msg::compositor_msg::{LayerId, ScriptToCompositorMsg};
use msg::constellation_msg::Msg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, FocusType, LoadData};
use msg::constellation_msg::{MozBrowserEvent, PipelineExitType, PipelineId};
use msg::constellation_msg::{PipelineNamespace};
use msg::constellation_msg::{SubpageId, WindowSizeData, WorkerId};
use msg::webdriver_msg::WebDriverScriptCommand;
use net_traits::LoadData as NetLoadData;
@@ -468,6 +469,8 @@ impl ScriptTaskFactory for ScriptTask {
let layout_chan = LayoutChan(layout_chan.sender());
let failure_info = state.failure_info;
spawn_named_with_send_on_failure(format!("ScriptTask {:?}", state.id), task_state::SCRIPT, move || {
PipelineNamespace::install(state.pipeline_namespace_id);
let roots = RootCollection::new();
let _stack_roots_tls = StackRootTLS::new(&roots);
let chan = MainThreadScriptChan(script_chan);
@@ -490,7 +493,7 @@ impl ScriptTaskFactory for ScriptTask {
load_data.url.clone());
script_task.start_page_load(new_load, load_data);
let reporter_name = format!("script-reporter-{}", id.0);
let reporter_name = format!("script-reporter-{}", id);
mem_profiler_chan.run_with_memory_reporting(|| {
script_task.start();
}, reporter_name, channel_for_reporter, CommonScriptMsg::CollectReports);