Auto merge of #7645 - nox:omtc-types, r=Ms2ger

Introduce structs for compositing and script task constructors' arguments

Extracted from @pcwalton's #4271.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7645)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-09-16 10:41:10 -06:00
commit 2879da54f9
8 changed files with 255 additions and 242 deletions

View file

@ -81,6 +81,8 @@ pub use export::gleam::gl;
use compositing::CompositorEventListener;
use compositing::windowing::WindowEvent;
use compositing::compositor_task::InitialCompositorState;
use compositing::constellation::InitialConstellationState;
use compositing::windowing::WindowMethods;
use compositing::{CompositorProxy, CompositorTask, Constellation};
@ -163,12 +165,13 @@ impl Browser {
// The compositor coordinates with the client window to create the final
// rendered page and display it somewhere.
let compositor = CompositorTask::create(window,
compositor_proxy,
compositor_receiver,
constellation_chan,
time_profiler_chan,
mem_profiler_chan);
let compositor = CompositorTask::create(window, InitialCompositorState {
sender: compositor_proxy,
receiver: compositor_receiver,
constellation_chan: constellation_chan,
time_profiler_chan: time_profiler_chan,
mem_profiler_chan: mem_profiler_chan,
});
Browser {
compositor: compositor,
@ -208,17 +211,20 @@ fn create_constellation(opts: opts::Opts,
let font_cache_task = FontCacheTask::new(resource_task.clone());
let storage_task: StorageTask = StorageTaskFactory::new();
let constellation_chan = Constellation::<layout::layout_task::LayoutTask,
script::script_task::ScriptTask>::start(
compositor_proxy,
resource_task,
image_cache_task,
font_cache_task,
time_profiler_chan,
mem_profiler_chan,
devtools_chan,
storage_task,
supports_clipboard);
let initial_state = InitialConstellationState {
compositor_proxy: compositor_proxy,
devtools_chan: devtools_chan,
image_cache_task: image_cache_task,
font_cache_task: font_cache_task,
resource_task: resource_task,
storage_task: storage_task,
time_profiler_chan: time_profiler_chan,
mem_profiler_chan: mem_profiler_chan,
supports_clipboard: supports_clipboard,
};
let constellation_chan =
Constellation::<layout::layout_task::LayoutTask,
script::script_task::ScriptTask>::start(initial_state);
// Send the URL command to the constellation.
match opts.url {