mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
Pass a String to spawn_named.
IntoString has been removed from Rust, and named() will take a String, so there is no good reason to do otherwise here.
This commit is contained in:
parent
94ebc7c32d
commit
808315926c
15 changed files with 36 additions and 25 deletions
|
@ -9,6 +9,7 @@ use resource_task::ProgressMsg::{Payload, Done};
|
|||
|
||||
use servo_util::task::spawn_named;
|
||||
use servo_util::taskpool::TaskPool;
|
||||
use std::borrow::ToOwned;
|
||||
use std::comm::{channel, Receiver, Sender};
|
||||
use std::collections::HashMap;
|
||||
use std::collections::hash_map::{Occupied, Vacant};
|
||||
|
@ -85,7 +86,7 @@ impl ImageCacheTask {
|
|||
let (chan, port) = channel();
|
||||
let chan_clone = chan.clone();
|
||||
|
||||
spawn_named("ImageCacheTask", proc() {
|
||||
spawn_named("ImageCacheTask".to_owned(), proc() {
|
||||
let mut cache = ImageCache {
|
||||
resource_task: resource_task,
|
||||
port: port,
|
||||
|
@ -106,7 +107,7 @@ impl ImageCacheTask {
|
|||
pub fn new_sync(resource_task: ResourceTask, task_pool: TaskPool) -> ImageCacheTask {
|
||||
let (chan, port) = channel();
|
||||
|
||||
spawn_named("ImageCacheTask (sync)", proc() {
|
||||
spawn_named("ImageCacheTask (sync)".to_owned(), proc() {
|
||||
let inner_cache = ImageCacheTask::new(resource_task, task_pool);
|
||||
|
||||
loop {
|
||||
|
@ -248,7 +249,7 @@ impl ImageCache {
|
|||
let resource_task = self.resource_task.clone();
|
||||
let url_clone = url.clone();
|
||||
|
||||
spawn_named("ImageCacheTask (prefetch)", proc() {
|
||||
spawn_named("ImageCacheTask (prefetch)".to_owned(), proc() {
|
||||
let url = url_clone;
|
||||
debug!("image_cache_task: started fetch for {}", url.serialize());
|
||||
|
||||
|
@ -469,7 +470,7 @@ fn load_image_data(url: Url, resource_task: ResourceTask) -> Result<Vec<u8>, ()>
|
|||
pub fn spawn_listener<A: Send>(f: proc(Receiver<A>):Send) -> Sender<A> {
|
||||
let (setup_chan, setup_port) = channel();
|
||||
|
||||
spawn_named("ImageCacheTask (listener)", proc() {
|
||||
spawn_named("ImageCacheTask (listener)".to_owned(), proc() {
|
||||
let (chan, port) = channel();
|
||||
setup_chan.send(chan);
|
||||
f(port);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue