aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamil Muszyński <muszynski.kamil@gmail.com>2016-02-17 21:25:12 +0100
committerKamil Muszyński <muszynski.kamil@gmail.com>2016-02-17 21:25:12 +0100
commitc6dfd7e2fab84fc7d5cb201d855dc6409f985684 (patch)
tree773d2b16d34f7f525d471ddd0edf8a502e42e44b
parent61f09cce4e7c1681fd1f7fbefada596316f06809 (diff)
downloadservo-c6dfd7e2fab84fc7d5cb201d855dc6409f985684.tar.gz
servo-c6dfd7e2fab84fc7d5cb201d855dc6409f985684.zip
Issue #9561 continued - renamed *_thread_source to *_task_source in global.rs and related files
-rw-r--r--components/script/dom/bindings/global.rs10
-rw-r--r--components/script/dom/filereader.rs4
-rw-r--r--components/script/dom/storage.rs2
-rw-r--r--components/script/dom/websocket.rs10
-rw-r--r--components/script/dom/worker.rs6
-rw-r--r--components/script/dom/xmlhttprequest.rs6
6 files changed, 19 insertions, 19 deletions
diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs
index 4559db0f06e..e0e558e0f0f 100644
--- a/components/script/dom/bindings/global.rs
+++ b/components/script/dom/bindings/global.rs
@@ -142,7 +142,7 @@ impl<'a> GlobalRef<'a> {
/// `ScriptChan` used to send messages to the event loop of this global's
/// thread.
- pub fn dom_manipulation_thread_source(&self) -> Box<ScriptChan + Send> {
+ pub fn dom_manipulation_task_source(&self) -> Box<ScriptChan + Send> {
match *self {
GlobalRef::Window(ref window) => window.dom_manipulation_task_source(),
GlobalRef::Worker(ref worker) => worker.script_chan(),
@@ -151,7 +151,7 @@ impl<'a> GlobalRef<'a> {
/// `ScriptChan` used to send messages to the event loop of this global's
/// thread.
- pub fn user_interaction_thread_source(&self) -> Box<ScriptChan + Send> {
+ pub fn user_interaction_task_source(&self) -> Box<ScriptChan + Send> {
match *self {
GlobalRef::Window(ref window) => window.user_interaction_task_source(),
GlobalRef::Worker(ref worker) => worker.script_chan(),
@@ -160,7 +160,7 @@ impl<'a> GlobalRef<'a> {
/// `ScriptChan` used to send messages to the event loop of this global's
/// thread.
- pub fn networking_thread_source(&self) -> Box<ScriptChan + Send> {
+ pub fn networking_task_source(&self) -> Box<ScriptChan + Send> {
match *self {
GlobalRef::Window(ref window) => window.networking_task_source(),
GlobalRef::Worker(ref worker) => worker.script_chan(),
@@ -169,7 +169,7 @@ impl<'a> GlobalRef<'a> {
/// `ScriptChan` used to send messages to the event loop of this global's
/// thread.
- pub fn history_traversal_thread_source(&self) -> Box<ScriptChan + Send> {
+ pub fn history_traversal_task_source(&self) -> Box<ScriptChan + Send> {
match *self {
GlobalRef::Window(ref window) => window.history_traversal_task_source(),
GlobalRef::Worker(ref worker) => worker.script_chan(),
@@ -178,7 +178,7 @@ impl<'a> GlobalRef<'a> {
/// `ScriptChan` used to send messages to the event loop of this global's
/// thread.
- pub fn file_reading_thread_source(&self) -> Box<ScriptChan + Send> {
+ pub fn file_reading_task_source(&self) -> Box<ScriptChan + Send> {
match *self {
GlobalRef::Window(ref window) => window.file_reading_task_source(),
GlobalRef::Worker(ref worker) => worker.script_chan(),
diff --git a/components/script/dom/filereader.rs b/components/script/dom/filereader.rs
index 7c0aa1c2c0c..e62e556f357 100644
--- a/components/script/dom/filereader.rs
+++ b/components/script/dom/filereader.rs
@@ -358,10 +358,10 @@ impl FileReader {
let load_data = ReadMetaData::new(String::from(type_), label.map(String::from), function);
- let fr = Trusted::new(self, global.file_reading_thread_source());
+ let fr = Trusted::new(self, global.file_reading_task_source());
let gen_id = self.generation_id.get();
- let script_chan = global.file_reading_thread_source();
+ let script_chan = global.file_reading_task_source();
spawn_named("file reader async operation".to_owned(), move || {
perform_annotated_read_operation(gen_id, load_data, blob_contents, fr, script_chan)
diff --git a/components/script/dom/storage.rs b/components/script/dom/storage.rs
index 39664098b64..c5d79fe7baf 100644
--- a/components/script/dom/storage.rs
+++ b/components/script/dom/storage.rs
@@ -154,7 +154,7 @@ impl Storage {
let global_root = self.global();
let global_ref = global_root.r();
let main_script_chan = global_ref.as_window().main_thread_script_chan();
- let script_chan = global_ref.dom_manipulation_thread_source();
+ let script_chan = global_ref.dom_manipulation_task_source();
let trusted_storage = Trusted::new(self, script_chan);
main_script_chan.send(MainThreadScriptMsg::MainThreadRunnableMsg(
box StorageEventRunnable::new(trusted_storage, key, old_value, new_value))).unwrap();
diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs
index 949f1c683a2..5f86ec6b0cd 100644
--- a/components/script/dom/websocket.rs
+++ b/components/script/dom/websocket.rs
@@ -237,7 +237,7 @@ impl WebSocket {
// Step 7.
let ws = WebSocket::new(global, resource_url.clone());
- let address = Trusted::new(ws.r(), global.networking_thread_source());
+ let address = Trusted::new(ws.r(), global.networking_task_source());
let connect_data = WebSocketConnectData {
resource_url: resource_url.clone(),
@@ -264,7 +264,7 @@ impl WebSocket {
*ws.sender.borrow_mut() = Some(dom_action_sender);
let moved_address = address.clone();
- let sender = global.networking_thread_source();
+ let sender = global.networking_task_source();
thread::spawn(move || {
while let Ok(event) = dom_event_receiver.recv() {
match event {
@@ -307,7 +307,7 @@ impl WebSocket {
};
let global = self.global();
- let chan = global.r().networking_thread_source();
+ let chan = global.r().networking_task_source();
let address = Trusted::new(self, chan.clone());
match data_byte_len.checked_add(self.buffered_amount.get()) {
@@ -433,7 +433,7 @@ impl WebSocketMethods for WebSocket {
self.ready_state.set(WebSocketRequestState::Closing);
let global = self.global();
- let sender = global.r().networking_thread_source();
+ let sender = global.r().networking_task_source();
let address = Trusted::new(self, sender.clone());
fail_the_websocket_connection(address, sender);
}
@@ -467,7 +467,7 @@ impl Runnable for ConnectionEstablishedTask {
// Step 1: Protocols.
if !self.protocols.is_empty() && self.headers.get::<WebSocketProtocol>().is_none() {
- let sender = global.r().networking_thread_source();
+ let sender = global.r().networking_task_source();
fail_the_websocket_connection(self.addr, sender);
return;
}
diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs
index 685dcd6ab43..815100ba32f 100644
--- a/components/script/dom/worker.rs
+++ b/components/script/dom/worker.rs
@@ -71,7 +71,7 @@ impl Worker {
let (sender, receiver) = channel();
let worker = Worker::new(global, sender.clone());
- let worker_ref = Trusted::new(worker.r(), global.dom_manipulation_thread_source());
+ let worker_ref = Trusted::new(worker.r(), global.dom_manipulation_task_source());
let worker_id = global.get_next_worker_id();
let (devtools_sender, devtools_receiver) = ipc::channel().unwrap();
@@ -102,7 +102,7 @@ impl Worker {
};
DedicatedWorkerGlobalScope::run_worker_scope(
init, worker_url, global.pipeline(), devtools_receiver, worker_ref,
- global.dom_manipulation_thread_source(), sender, receiver);
+ global.dom_manipulation_task_source(), sender, receiver);
Ok(worker)
}
@@ -141,7 +141,7 @@ impl WorkerMethods for Worker {
// https://html.spec.whatwg.org/multipage/#dom-dedicatedworkerglobalscope-postmessage
fn PostMessage(&self, cx: *mut JSContext, message: HandleValue) -> ErrorResult {
let data = try!(StructuredCloneData::write(cx, message));
- let address = Trusted::new(self, self.global().r().dom_manipulation_thread_source());
+ let address = Trusted::new(self, self.global().r().dom_manipulation_task_source());
self.sender.send((address, WorkerScriptMsg::DOMMessage(data))).unwrap();
Ok(())
}
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs
index 8f1e8ade718..49075d33108 100644
--- a/components/script/dom/xmlhttprequest.rs
+++ b/components/script/dom/xmlhttprequest.rs
@@ -1034,7 +1034,7 @@ impl XMLHttpRequest {
// This will cancel all previous timeouts
let global = self.global();
let callback = ScheduledXHRTimeout {
- xhr: Trusted::new(self, global.r().networking_thread_source()),
+ xhr: Trusted::new(self, global.r().networking_task_source()),
generation_id: self.generation_id.get(),
};
let duration = Length::new(duration_ms as u64);
@@ -1234,7 +1234,7 @@ impl XMLHttpRequest {
Ok(req) => req,
};
- let xhr = Trusted::new(self, global.networking_thread_source());
+ let xhr = Trusted::new(self, global.networking_task_source());
let context = Arc::new(Mutex::new(XHRContext {
xhr: xhr,
@@ -1248,7 +1248,7 @@ impl XMLHttpRequest {
let (tx, rx) = global.new_script_pair();
(tx, Some(rx))
} else {
- (global.networking_thread_source(), None)
+ (global.networking_task_source(), None)
};
let resource_thread = global.resource_thread();