Issue #9561 Renamed *_thread_source to *_task_source and ThreadSource to TaskSource

This commit is contained in:
Kamil Muszyński 2016-02-14 15:29:44 +01:00
parent 3f74c07e20
commit 076cc409e6
8 changed files with 96 additions and 96 deletions

View file

@ -144,7 +144,7 @@ impl<'a> GlobalRef<'a> {
/// thread.
pub fn dom_manipulation_thread_source(&self) -> Box<ScriptChan + Send> {
match *self {
GlobalRef::Window(ref window) => window.dom_manipulation_thread_source(),
GlobalRef::Window(ref window) => window.dom_manipulation_task_source(),
GlobalRef::Worker(ref worker) => worker.script_chan(),
}
}
@ -153,7 +153,7 @@ impl<'a> GlobalRef<'a> {
/// thread.
pub fn user_interaction_thread_source(&self) -> Box<ScriptChan + Send> {
match *self {
GlobalRef::Window(ref window) => window.user_interaction_thread_source(),
GlobalRef::Window(ref window) => window.user_interaction_task_source(),
GlobalRef::Worker(ref worker) => worker.script_chan(),
}
}
@ -162,7 +162,7 @@ impl<'a> GlobalRef<'a> {
/// thread.
pub fn networking_thread_source(&self) -> Box<ScriptChan + Send> {
match *self {
GlobalRef::Window(ref window) => window.networking_thread_source(),
GlobalRef::Window(ref window) => window.networking_task_source(),
GlobalRef::Worker(ref worker) => worker.script_chan(),
}
}
@ -171,7 +171,7 @@ impl<'a> GlobalRef<'a> {
/// thread.
pub fn history_traversal_thread_source(&self) -> Box<ScriptChan + Send> {
match *self {
GlobalRef::Window(ref window) => window.history_traversal_thread_source(),
GlobalRef::Window(ref window) => window.history_traversal_task_source(),
GlobalRef::Worker(ref worker) => worker.script_chan(),
}
}
@ -180,7 +180,7 @@ impl<'a> GlobalRef<'a> {
/// thread.
pub fn file_reading_thread_source(&self) -> Box<ScriptChan + Send> {
match *self {
GlobalRef::Window(ref window) => window.file_reading_thread_source(),
GlobalRef::Window(ref window) => window.file_reading_task_source(),
GlobalRef::Worker(ref worker) => worker.script_chan(),
}
}

View file

@ -83,7 +83,7 @@ impl ToggleEventRunnable {
pub fn send(node: &HTMLDetailsElement, toggle_number: u32) {
let window = window_from_node(node);
let window = window.r();
let chan = window.dom_manipulation_thread_source();
let chan = window.dom_manipulation_task_source();
let handler = Trusted::new(node, chan.clone());
let dispatcher = ToggleEventRunnable {
element: handler,

View file

@ -110,9 +110,9 @@ impl HTMLImageElement {
let img_url = img_url.unwrap();
*self.url.borrow_mut() = Some(img_url.clone());
let trusted_node = Trusted::new(self, window.networking_thread_source());
let trusted_node = Trusted::new(self, window.networking_task_source());
let (responder_sender, responder_receiver) = ipc::channel().unwrap();
let script_chan = window.networking_thread_source();
let script_chan = window.networking_task_source();
let wrapper = window.get_runnable_wrapper();
ROUTER.add_route(responder_receiver.to_opaque(), box move |message| {
// Return the image via a message to the script thread, which marks the element

View file

@ -936,7 +936,7 @@ impl ChangeEventRunnable {
pub fn send(node: &Node) {
let window = window_from_node(node);
let window = window.r();
let chan = window.user_interaction_thread_source();
let chan = window.user_interaction_task_source();
let handler = Trusted::new(node, chan.clone());
let dispatcher = ChangeEventRunnable {
element: handler,

View file

@ -198,7 +198,7 @@ impl HTMLLinkElement {
// TODO: #8085 - Don't load external stylesheets if the node's mq doesn't match.
let doc = window.Document();
let script_chan = window.networking_thread_source();
let script_chan = window.networking_task_source();
let elem = Trusted::new(self, script_chan.clone());
let context = Arc::new(Mutex::new(StylesheetContext {

View file

@ -283,7 +283,7 @@ impl HTMLScriptElement {
// Step 16.6.
// TODO(#9186): use the fetch infrastructure.
let script_chan = window.networking_thread_source();
let script_chan = window.networking_task_source();
let elem = Trusted::new(self, script_chan.clone());
let context = Arc::new(Mutex::new(ScriptContext {
@ -442,7 +442,7 @@ impl HTMLScriptElement {
if external {
self.dispatch_load_event();
} else {
let chan = window.dom_manipulation_thread_source();
let chan = window.dom_manipulation_task_source();
let handler = Trusted::new(self, chan.clone());
let dispatcher = box EventDispatcher {
element: handler,
@ -455,7 +455,7 @@ impl HTMLScriptElement {
pub fn queue_error_event(&self) {
let window = window_from_node(self);
let window = window.r();
let chan = window.dom_manipulation_thread_source();
let chan = window.dom_manipulation_task_source();
let handler = Trusted::new(self, chan.clone());
let dispatcher = box EventDispatcher {
element: handler,

View file

@ -53,8 +53,8 @@ use page::Page;
use profile_traits::mem;
use reporter::CSSErrorReporter;
use rustc_serialize::base64::{FromBase64, STANDARD, ToBase64};
use script_thread::{DOMManipulationThreadSource, UserInteractionThreadSource, NetworkingThreadSource};
use script_thread::{HistoryTraversalThreadSource, FileReadingThreadSource, SendableMainThreadScriptChan};
use script_thread::{DOMManipulationTaskSource, UserInteractionTaskSource, NetworkingTaskSource};
use script_thread::{HistoryTraversalTaskSource, FileReadingTaskSource, SendableMainThreadScriptChan};
use script_thread::{ScriptChan, ScriptPort, MainThreadScriptChan, MainThreadScriptMsg, RunnableWrapper};
use script_traits::ConstellationControlMsg;
use script_traits::{DocumentState, MsDuration, ScriptToCompositorMsg, TimerEvent, TimerEventId};
@ -120,16 +120,16 @@ pub struct Window {
eventtarget: EventTarget,
#[ignore_heap_size_of = "trait objects are hard"]
script_chan: MainThreadScriptChan,
#[ignore_heap_size_of = "thread sources are hard"]
dom_manipulation_thread_source: DOMManipulationThreadSource,
#[ignore_heap_size_of = "thread sources are hard"]
user_interaction_thread_source: UserInteractionThreadSource,
#[ignore_heap_size_of = "thread sources are hard"]
networking_thread_source: NetworkingThreadSource,
#[ignore_heap_size_of = "thread sources are hard"]
history_traversal_thread_source: HistoryTraversalThreadSource,
#[ignore_heap_size_of = "thread sources are hard"]
file_reading_thread_source: FileReadingThreadSource,
#[ignore_heap_size_of = "task sources are hard"]
dom_manipulation_task_source: DOMManipulationTaskSource,
#[ignore_heap_size_of = "task sources are hard"]
user_interaction_task_source: UserInteractionTaskSource,
#[ignore_heap_size_of = "task sources are hard"]
networking_task_source: NetworkingTaskSource,
#[ignore_heap_size_of = "task sources are hard"]
history_traversal_task_source: HistoryTraversalTaskSource,
#[ignore_heap_size_of = "task sources are hard"]
file_reading_task_source: FileReadingTaskSource,
console: MutNullableHeap<JS<Console>>,
crypto: MutNullableHeap<JS<Crypto>>,
navigator: MutNullableHeap<JS<Navigator>>,
@ -253,24 +253,24 @@ impl Window {
self.js_runtime.borrow().as_ref().unwrap().cx()
}
pub fn dom_manipulation_thread_source(&self) -> Box<ScriptChan + Send> {
self.dom_manipulation_thread_source.clone()
pub fn dom_manipulation_task_source(&self) -> Box<ScriptChan + Send> {
self.dom_manipulation_task_source.clone()
}
pub fn user_interaction_thread_source(&self) -> Box<ScriptChan + Send> {
self.user_interaction_thread_source.clone()
pub fn user_interaction_task_source(&self) -> Box<ScriptChan + Send> {
self.user_interaction_task_source.clone()
}
pub fn networking_thread_source(&self) -> Box<ScriptChan + Send> {
self.networking_thread_source.clone()
pub fn networking_task_source(&self) -> Box<ScriptChan + Send> {
self.networking_task_source.clone()
}
pub fn history_traversal_thread_source(&self) -> Box<ScriptChan + Send> {
self.history_traversal_thread_source.clone()
pub fn history_traversal_task_source(&self) -> Box<ScriptChan + Send> {
self.history_traversal_task_source.clone()
}
pub fn file_reading_thread_source(&self) -> Box<ScriptChan + Send> {
self.file_reading_thread_source.clone()
pub fn file_reading_task_source(&self) -> Box<ScriptChan + Send> {
self.file_reading_task_source.clone()
}
pub fn main_thread_script_chan(&self) -> &Sender<MainThreadScriptMsg> {
@ -1292,11 +1292,11 @@ impl Window {
pub fn new(runtime: Rc<Runtime>,
page: Rc<Page>,
script_chan: MainThreadScriptChan,
dom_thread_source: DOMManipulationThreadSource,
user_thread_source: UserInteractionThreadSource,
network_thread_source: NetworkingThreadSource,
history_thread_source: HistoryTraversalThreadSource,
file_thread_source: FileReadingThreadSource,
dom_task_source: DOMManipulationTaskSource,
user_task_source: UserInteractionTaskSource,
network_task_source: NetworkingTaskSource,
history_task_source: HistoryTraversalTaskSource,
file_task_source: FileReadingTaskSource,
image_cache_chan: ImageCacheChan,
compositor: IpcSender<ScriptToCompositorMsg>,
image_cache_thread: ImageCacheThread,
@ -1326,11 +1326,11 @@ impl Window {
let win = box Window {
eventtarget: EventTarget::new_inherited(),
script_chan: script_chan,
dom_manipulation_thread_source: dom_thread_source,
user_interaction_thread_source: user_thread_source,
networking_thread_source: network_thread_source,
history_traversal_thread_source: history_thread_source,
file_reading_thread_source: file_thread_source,
dom_manipulation_task_source: dom_task_source,
user_interaction_task_source: user_task_source,
networking_task_source: network_task_source,
history_traversal_task_source: history_task_source,
file_reading_task_source: file_task_source,
image_cache_chan: image_cache_chan,
console: Default::default(),
crypto: Default::default(),