Use associated types to improve LayoutThreadFactory and ScriptThreadFactory.

This commit is contained in:
Ms2ger 2016-05-24 17:50:06 +02:00
parent cd1396fa9a
commit 49d244d39c
8 changed files with 47 additions and 78 deletions

View file

@ -409,13 +409,11 @@ pub struct UnprivilegedPipelineContent {
}
impl UnprivilegedPipelineContent {
pub fn start_all<LTF, STF>(mut self, wait_for_completion: bool)
where LTF: LayoutThreadFactory,
STF: ScriptThreadFactory
pub fn start_all<Message, LTF, STF>(mut self, wait_for_completion: bool)
where LTF: LayoutThreadFactory<Message=Message>,
STF: ScriptThreadFactory<Message=Message>
{
let layout_pair = STF::create_layout_channel();
STF::create(InitialScriptState {
let layout_pair = STF::create(InitialScriptState {
id: self.id,
parent_info: self.parent_info,
compositor: self.script_to_compositor_chan,
@ -434,7 +432,7 @@ impl UnprivilegedPipelineContent {
window_size: self.window_size,
pipeline_namespace_id: self.pipeline_namespace_id,
content_process_shutdown_chan: self.script_content_process_shutdown_chan.clone(),
}, &layout_pair, self.load_data.clone());
}, self.load_data.clone());
LTF::create(self.id,
self.load_data.url.clone(),