compositing: Move messages that go over the ScriptListener to go over

an IPC channel instead.

Because this used a boxed trait object to invoke messages across a
process boundary, and boxed trait objects are not supported across IPC,
we spawn a helper thread inside the compositor to perform the marshaling
for us.
This commit is contained in:
Patrick Walton 2015-07-10 18:08:03 -07:00
parent 2947d78e4e
commit e841065351
14 changed files with 211 additions and 82 deletions

View file

@ -105,7 +105,7 @@ pub struct Window {
navigator: MutNullableHeap<JS<Navigator>>,
image_cache_task: ImageCacheTask,
image_cache_chan: ImageCacheChan,
compositor: DOMRefCell<Box<ScriptListener+'static>>,
compositor: DOMRefCell<ScriptListener>,
browser_context: DOMRefCell<Option<BrowserContext>>,
page: Rc<Page>,
performance: MutNullableHeap<JS<Performance>>,
@ -241,7 +241,7 @@ impl Window {
&self.image_cache_task
}
pub fn compositor<'a>(&'a self) -> RefMut<'a, Box<ScriptListener+'static>> {
pub fn compositor<'a>(&'a self) -> RefMut<'a, ScriptListener> {
self.compositor.borrow_mut()
}
@ -964,7 +964,7 @@ impl Window {
script_chan: Box<ScriptChan+Send>,
image_cache_chan: ImageCacheChan,
control_chan: ScriptControlChan,
compositor: Box<ScriptListener+'static>,
compositor: ScriptListener,
image_cache_task: ImageCacheTask,
resource_task: ResourceTask,
storage_task: StorageTask,