Skip to content

Commit

Permalink
Auto merge of #9576 - kmuszyn:9561-rename-thread-to-task, r=jdm
Browse files Browse the repository at this point in the history
Issue #9561 Renamed *_thread_source to *_task_source window.rs

Related to: #9561

Renamed *thread_source to *_task_source in components/script/dom/window.rs and files that use window methods.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9576)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Feb 14, 2016
2 parents 3f74c07 + 076cc40 commit c929dbe
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 96 deletions.
10 changes: 5 additions & 5 deletions components/script/dom/bindings/global.rs
Expand Up @@ -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(),
}
}
Expand All @@ -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(),
}
}
Expand All @@ -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(),
}
}
Expand All @@ -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(),
}
}
Expand All @@ -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(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmldetailselement.rs
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/htmlimageelement.rs
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmlinputelement.rs
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmllinkelement.rs
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions components/script/dom/htmlscriptelement.rs
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
64 changes: 32 additions & 32 deletions components/script/dom/window.rs
Expand Up @@ -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};
Expand Down Expand Up @@ -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>>,
Expand Down Expand Up @@ -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> {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit c929dbe

Please sign in to comment.