Implement trait-based ResourceThreads and clean up related naming issues

Changes include:

- Introduce an IpcSend trait to abstract over a collection of IpcSenders
- Implement ResourceThreads collection to abstract the resource-related
  sub threads across the component
- Rename original ResourceThread and ControlMsg into an unifed CoreResource__
  to accommodate above changes and avoid confusions
This commit is contained in:
Zhen Zhang 2016-05-18 00:07:42 +08:00
parent 051a749e0d
commit a51db4cfa8
22 changed files with 213 additions and 179 deletions

View file

@ -72,7 +72,7 @@ impl Worker {
Err(_) => return Err(Error::Syntax),
};
let resource_thread = global.resource_thread();
let core_resource_thread = global.core_resource_thread();
let constellation_chan = global.constellation_chan().clone();
let scheduler_chan = global.scheduler_chan().clone();
@ -100,7 +100,7 @@ impl Worker {
};
let init = WorkerGlobalScopeInit {
resource_thread: resource_thread,
core_resource_thread: core_resource_thread,
mem_profiler_chan: global.mem_profiler_chan().clone(),
time_profiler_chan: global.time_profiler_chan().clone(),
to_devtools_sender: global.devtools_chan(),