auto merge of #4548 : Ms2ger/servo/cleanup, r=Manishearth

This commit is contained in:
bors-servo 2015-01-05 01:27:48 -07:00
commit 65ee8166bd
7 changed files with 10 additions and 21 deletions

View file

@ -224,7 +224,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send {
debug!("paint_task: shutdown_chan send");
shutdown_chan.send(());
}, ConstellationMsg::Failure(failure_msg), c, true);
}, ConstellationMsg::Failure(failure_msg), c);
}
fn start(&mut self) {

View file

@ -202,7 +202,7 @@ impl LayoutTaskFactory for LayoutTask {
layout.start();
}
shutdown_chan.send(());
}, ConstellationMsg::Failure(failure_msg), con_chan, false);
}, ConstellationMsg::Failure(failure_msg), con_chan);
}
}

View file

@ -23,7 +23,7 @@ use script_task::{ScriptTask, ScriptChan, ScriptMsg, TimerSource};
use script_task::StackRootTLS;
use servo_net::resource_task::{ResourceTask, load_whole_resource};
use servo_util::task::spawn_named_native;
use servo_util::task::spawn_named;
use servo_util::task_state;
use servo_util::task_state::{SCRIPT, IN_WORKER};
@ -135,8 +135,7 @@ impl DedicatedWorkerGlobalScope {
parent_sender: Box<ScriptChan+Send>,
own_sender: Sender<(TrustedWorkerAddress, ScriptMsg)>,
receiver: Receiver<(TrustedWorkerAddress, ScriptMsg)>) {
spawn_named_native(format!("WebWorker for {}", worker_url.serialize()), proc() {
spawn_named(format!("WebWorker for {}", worker_url.serialize()), proc() {
task_state::initialize(SCRIPT | IN_WORKER);
let roots = RootCollection::new();

View file

@ -50,7 +50,7 @@ use dom::htmlscriptelement::HTMLScriptElement;
use dom::htmlselectelement::HTMLSelectElement;
use dom::htmlstyleelement::HTMLStyleElement;
use dom::htmltableelement::HTMLTableElement;
use dom::htmltablecellelement::{HTMLTableCellElement, HTMLTableCellElementTypeId};
use dom::htmltablecellelement::HTMLTableCellElement;
use dom::htmltablerowelement::HTMLTableRowElement;
use dom::htmltablesectionelement::HTMLTableSectionElement;
use dom::htmltextareaelement::HTMLTextAreaElement;
@ -216,12 +216,7 @@ pub fn vtable_for<'a>(node: &'a JSRef<'a, Node>) -> &'a (VirtualMethods + 'a) {
HTMLTableElementCast::to_borrowed_ref(node).unwrap();
element as &'a (VirtualMethods + 'a)
}
NodeTypeId::Element(ElementTypeId::HTMLElement(
HTMLElementTypeId::HTMLTableCellElement(
HTMLTableCellElementTypeId::HTMLTableDataCellElement))) |
NodeTypeId::Element(ElementTypeId::HTMLElement(
HTMLElementTypeId::HTMLTableCellElement(
HTMLTableCellElementTypeId::HTMLTableHeaderCellElement))) => {
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTableCellElement(_))) => {
let element: &'a JSRef<'a, HTMLTableCellElement> =
HTMLTableCellElementCast::to_borrowed_ref(node).unwrap();
element as &'a (VirtualMethods + 'a)

View file

@ -314,7 +314,7 @@ impl ScriptTaskFactory for ScriptTask {
// This must always be the very last operation performed before the task completes
failsafe.neuter();
}, ConstellationMsg::Failure(failure_msg), const_chan, false);
}, ConstellationMsg::Failure(failure_msg), const_chan);
}
}

View file

@ -16,17 +16,12 @@ pub fn spawn_named<S: IntoMaybeOwned<'static>>(name: S, f: proc():Send) {
});
}
pub fn spawn_named_native<S: IntoMaybeOwned<'static>>(name: S, f: proc():Send) {
spawn_named(name, f)
}
/// Arrange to send a particular message to a channel if the task fails.
pub fn spawn_named_with_send_on_failure<T: Send>(name: &'static str,
state: task_state::TaskState,
f: proc(): Send,
msg: T,
dest: Sender<T>,
_native: bool) {
dest: Sender<T>) {
let future_result = TaskBuilder::new().named(name).try_future(proc() {
task_state::initialize(state);
rtinstrument::instrument(f);

View file

@ -7,7 +7,7 @@
//! Data associated with queues is simply a pair of unsigned integers. It is expected that a
//! higher-level API on top of this could allow safe fork-join parallelism.
use task::spawn_named_native;
use task::spawn_named;
use task_state;
use libc::funcs::posix88::unistd::usleep;
@ -248,7 +248,7 @@ impl<QueueData: Send, WorkData: Send> WorkQueue<QueueData, WorkData> {
// Spawn threads.
for (i, thread) in threads.into_iter().enumerate() {
spawn_named_native(
spawn_named(
format!("{} worker {}/{}", task_name, i+1, thread_count),
proc() {
task_state::initialize(state | task_state::IN_WORKER);