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

@ -15,6 +15,7 @@ use dom::event::{Event, EventBubbles, EventCancelable};
use dom::storageevent::StorageEvent;
use dom::urlhelper::UrlHelper;
use ipc_channel::ipc;
use net_traits::IpcSend;
use net_traits::storage_thread::{StorageThread, StorageThreadMsg, StorageType};
use script_thread::{MainThreadRunnable, ScriptThread};
use task_source::dom_manipulation::DOMManipulationTask;
@ -48,7 +49,7 @@ impl Storage {
fn get_storage_thread(&self) -> StorageThread {
let global_root = self.global();
let global_ref = global_root.r();
global_ref.as_window().storage_thread()
global_ref.as_window().resource_threads().sender()
}
}