mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
task -> thread
This commit is contained in:
parent
f00532bab0
commit
1f02c4ebbb
119 changed files with 1209 additions and 1207 deletions
|
@ -19,9 +19,9 @@ use js::jsapi::GetGlobalForObjectCrossCompartment;
|
|||
use js::jsapi::{JSContext, JSObject, JS_GetClass, MutableHandleValue};
|
||||
use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL};
|
||||
use msg::constellation_msg::{ConstellationChan, PipelineId};
|
||||
use net_traits::ResourceTask;
|
||||
use net_traits::ResourceThread;
|
||||
use profile_traits::mem;
|
||||
use script_task::{CommonScriptMsg, ScriptChan, ScriptPort, ScriptTask};
|
||||
use script_thread::{CommonScriptMsg, ScriptChan, ScriptPort, ScriptThread};
|
||||
use script_traits::{MsDuration, ScriptMsg as ConstellationMsg, TimerEventRequest};
|
||||
use timers::{ScheduledCallback, TimerHandle};
|
||||
use url::Url;
|
||||
|
@ -65,7 +65,7 @@ impl<'a> GlobalRef<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Extract a `Window`, causing task failure if the global object is not
|
||||
/// Extract a `Window`, causing thread failure if the global object is not
|
||||
/// a `Window`.
|
||||
pub fn as_window(&self) -> &window::Window {
|
||||
match *self {
|
||||
|
@ -82,7 +82,7 @@ impl<'a> GlobalRef<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Get a `mem::ProfilerChan` to send messages to the memory profiler task.
|
||||
/// Get a `mem::ProfilerChan` to send messages to the memory profiler thread.
|
||||
pub fn mem_profiler_chan(&self) -> mem::ProfilerChan {
|
||||
match *self {
|
||||
GlobalRef::Window(window) => window.mem_profiler_chan(),
|
||||
|
@ -107,7 +107,7 @@ impl<'a> GlobalRef<'a> {
|
|||
}
|
||||
|
||||
/// Get an `IpcSender<ScriptToDevtoolsControlMsg>` to send messages to Devtools
|
||||
/// task when available.
|
||||
/// thread when available.
|
||||
pub fn devtools_chan(&self) -> Option<IpcSender<ScriptToDevtoolsControlMsg>> {
|
||||
match *self {
|
||||
GlobalRef::Window(window) => window.devtools_chan(),
|
||||
|
@ -115,16 +115,16 @@ impl<'a> GlobalRef<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Get the `ResourceTask` for this global scope.
|
||||
pub fn resource_task(&self) -> ResourceTask {
|
||||
/// Get the `ResourceThread` for this global scope.
|
||||
pub fn resource_thread(&self) -> ResourceThread {
|
||||
match *self {
|
||||
GlobalRef::Window(ref window) => {
|
||||
let doc = window.Document();
|
||||
let doc = doc.r();
|
||||
let loader = doc.loader();
|
||||
(*loader.resource_task).clone()
|
||||
(*loader.resource_thread).clone()
|
||||
}
|
||||
GlobalRef::Worker(ref worker) => worker.resource_task().clone(),
|
||||
GlobalRef::Worker(ref worker) => worker.resource_thread().clone(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,45 +154,45 @@ impl<'a> GlobalRef<'a> {
|
|||
|
||||
/// `ScriptChan` used to send messages to the event loop of this global's
|
||||
/// thread.
|
||||
pub fn dom_manipulation_task_source(&self) -> Box<ScriptChan + Send> {
|
||||
pub fn dom_manipulation_thread_source(&self) -> Box<ScriptChan + Send> {
|
||||
match *self {
|
||||
GlobalRef::Window(ref window) => window.dom_manipulation_task_source(),
|
||||
GlobalRef::Window(ref window) => window.dom_manipulation_thread_source(),
|
||||
GlobalRef::Worker(ref worker) => worker.script_chan(),
|
||||
}
|
||||
}
|
||||
|
||||
/// `ScriptChan` used to send messages to the event loop of this global's
|
||||
/// thread.
|
||||
pub fn user_interaction_task_source(&self) -> Box<ScriptChan + Send> {
|
||||
pub fn user_interaction_thread_source(&self) -> Box<ScriptChan + Send> {
|
||||
match *self {
|
||||
GlobalRef::Window(ref window) => window.user_interaction_task_source(),
|
||||
GlobalRef::Window(ref window) => window.user_interaction_thread_source(),
|
||||
GlobalRef::Worker(ref worker) => worker.script_chan(),
|
||||
}
|
||||
}
|
||||
|
||||
/// `ScriptChan` used to send messages to the event loop of this global's
|
||||
/// thread.
|
||||
pub fn networking_task_source(&self) -> Box<ScriptChan + Send> {
|
||||
pub fn networking_thread_source(&self) -> Box<ScriptChan + Send> {
|
||||
match *self {
|
||||
GlobalRef::Window(ref window) => window.networking_task_source(),
|
||||
GlobalRef::Window(ref window) => window.networking_thread_source(),
|
||||
GlobalRef::Worker(ref worker) => worker.script_chan(),
|
||||
}
|
||||
}
|
||||
|
||||
/// `ScriptChan` used to send messages to the event loop of this global's
|
||||
/// thread.
|
||||
pub fn history_traversal_task_source(&self) -> Box<ScriptChan + Send> {
|
||||
pub fn history_traversal_thread_source(&self) -> Box<ScriptChan + Send> {
|
||||
match *self {
|
||||
GlobalRef::Window(ref window) => window.history_traversal_task_source(),
|
||||
GlobalRef::Window(ref window) => window.history_traversal_thread_source(),
|
||||
GlobalRef::Worker(ref worker) => worker.script_chan(),
|
||||
}
|
||||
}
|
||||
|
||||
/// `ScriptChan` used to send messages to the event loop of this global's
|
||||
/// thread.
|
||||
pub fn file_reading_task_source(&self) -> Box<ScriptChan + Send> {
|
||||
pub fn file_reading_thread_source(&self) -> Box<ScriptChan + Send> {
|
||||
match *self {
|
||||
GlobalRef::Window(ref window) => window.file_reading_task_source(),
|
||||
GlobalRef::Window(ref window) => window.file_reading_thread_source(),
|
||||
GlobalRef::Worker(ref worker) => worker.script_chan(),
|
||||
}
|
||||
}
|
||||
|
@ -207,11 +207,11 @@ impl<'a> GlobalRef<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Process a single event as if it were the next event in the task queue for
|
||||
/// Process a single event as if it were the next event in the thread queue for
|
||||
/// this global.
|
||||
pub fn process_event(&self, msg: CommonScriptMsg) {
|
||||
match *self {
|
||||
GlobalRef::Window(_) => ScriptTask::process_event(msg),
|
||||
GlobalRef::Window(_) => ScriptThread::process_event(msg),
|
||||
GlobalRef::Worker(ref worker) => worker.process_event(msg),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue