script: Make most of 2D canvas and WebGL run over IPC.

To actually make the multiprocess communication work, we'll need to
reroute the task creation to the pipeline or the compositor. But this
works as a first step.
This commit is contained in:
Patrick Walton 2015-07-13 17:02:35 -07:00
parent 886c08c393
commit bb99b2f3c8
39 changed files with 694 additions and 365 deletions

View file

@ -22,7 +22,7 @@ use timers::{IsInterval, TimerId, TimerManager, TimerCallback};
use devtools_traits::DevtoolsControlChan;
use msg::constellation_msg::{PipelineId, WorkerId};
use msg::constellation_msg::{ConstellationChan, PipelineId, WorkerId};
use profile_traits::mem;
use net_traits::{load_whole_resource, ResourceTask};
use util::str::DOMString;
@ -55,6 +55,7 @@ pub struct WorkerGlobalScope {
timers: TimerManager,
mem_profiler_chan: mem::ProfilerChan,
devtools_chan: Option<DevtoolsControlChan>,
constellation_chan: ConstellationChan,
}
impl WorkerGlobalScope {
@ -63,7 +64,8 @@ impl WorkerGlobalScope {
runtime: Rc<Runtime>,
resource_task: ResourceTask,
mem_profiler_chan: mem::ProfilerChan,
devtools_chan: Option<DevtoolsControlChan>) -> WorkerGlobalScope {
devtools_chan: Option<DevtoolsControlChan>,
constellation_chan: ConstellationChan) -> WorkerGlobalScope {
WorkerGlobalScope {
eventtarget: EventTarget::new_inherited(EventTargetTypeId::WorkerGlobalScope(type_id)),
next_worker_id: Cell::new(WorkerId(0)),
@ -77,6 +79,7 @@ impl WorkerGlobalScope {
timers: TimerManager::new(),
mem_profiler_chan: mem_profiler_chan,
devtools_chan: devtools_chan,
constellation_chan: constellation_chan,
}
}
@ -88,6 +91,10 @@ impl WorkerGlobalScope {
self.devtools_chan.clone()
}
pub fn constellation_chan(&self) -> ConstellationChan {
self.constellation_chan.clone()
}
#[inline]
pub fn eventtarget<'a>(&'a self) -> &'a EventTarget {
&self.eventtarget