add names for all servo spawned tasks

* add servo_util::task::{spawn_named,spawn_with_named} functions

* add name param for spawn_listener and spawn_conversation functions

this should resolve #1169
This commit is contained in:
zmike 2014-01-03 15:43:11 -05:00 committed by Mike Blumenkrantz
parent 99f24fbd40
commit 193b6d2635
19 changed files with 55 additions and 31 deletions

View file

@ -9,6 +9,7 @@ use encoding::EncodingRef;
use encoding::all::UTF_8;
use style::Stylesheet;
use servo_net::resource_task::{Load, LoadResponse, ProgressMsg, Payload, Done, ResourceTask};
use servo_util::task::spawn_named;
use extra::url::Url;
/// Where a style sheet comes from.
@ -25,7 +26,7 @@ pub fn spawn_css_parser(provenance: StylesheetProvenance,
// TODO: Get the actual value. http://dev.w3.org/csswg/css-syntax/#environment-encoding
let environment_encoding = UTF_8 as EncodingRef;
spawn(proc() {
spawn_named("cssparser", proc() {
// TODO: CSS parsing should take a base URL.
let _url = match provenance {
UrlProvenance(ref the_url) => (*the_url).clone(),

View file

@ -21,6 +21,7 @@ use servo_msg::constellation_msg::SubpageId;
use servo_net::image_cache_task::ImageCacheTask;
use servo_net::resource_task::{Load, Payload, Done, ResourceTask, load_whole_resource};
use servo_util::url::make_url;
use servo_util::task::spawn_named;
use std::cast;
use std::cell::RefCell;
use std::comm::{Port, SharedChan};
@ -255,7 +256,7 @@ pub fn parse_html(cx: *JSContext,
let (discovery_port, discovery_chan) = SharedChan::new();
let stylesheet_chan = discovery_chan.clone();
let (css_msg_port, css_chan) = SharedChan::new();
spawn(proc() {
spawn_named("parse_html:css", proc() {
css_link_listener(stylesheet_chan, css_msg_port, resource_task2.clone());
});
@ -263,7 +264,7 @@ pub fn parse_html(cx: *JSContext,
let resource_task2 = resource_task.clone();
let js_result_chan = discovery_chan.clone();
let (js_msg_port, js_chan) = SharedChan::new();
spawn(proc() {
spawn_named("parse_html:js", proc() {
js_script_listener(js_result_chan, js_msg_port, resource_task2.clone());
});