mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Run all task spawning through util, to allow for easy hooking.
During debugging, I found it useful to hook all task creation in a central location, and util::task was the perfect place for it. r? @pcwalton (or maybe someone else, I'm kinda sending you a bunch of reviews today because I don't know who better to give them to)
This commit is contained in:
parent
9e94ecf99c
commit
6df1cc8e4c
14 changed files with 48 additions and 36 deletions
|
@ -10,7 +10,6 @@ use file_loader;
|
|||
use http_loader;
|
||||
|
||||
use std::comm::{channel, Receiver, Sender};
|
||||
use std::task::TaskBuilder;
|
||||
use http::headers::content_type::MediaType;
|
||||
use http::headers::response::HeaderCollection as ResponseHeaderCollection;
|
||||
use http::headers::request::HeaderCollection as RequestHeaderCollection;
|
||||
|
@ -20,6 +19,7 @@ use url::Url;
|
|||
use http::status::Ok as StatusOk;
|
||||
use http::status::Status;
|
||||
|
||||
use servo_util::task::spawn_named;
|
||||
|
||||
pub enum ControlMsg {
|
||||
/// Request the data associated with a particular URL
|
||||
|
@ -166,8 +166,7 @@ pub type ResourceTask = Sender<ControlMsg>;
|
|||
/// Create a ResourceTask
|
||||
pub fn new_resource_task(user_agent: Option<String>) -> ResourceTask {
|
||||
let (setup_chan, setup_port) = channel();
|
||||
let builder = TaskBuilder::new().named("ResourceManager");
|
||||
builder.spawn(proc() {
|
||||
spawn_named("ResourceManager", proc() {
|
||||
ResourceManager::new(setup_port, user_agent).start();
|
||||
});
|
||||
setup_chan
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue