diff options
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/xmlhttprequest.rs | 6 | ||||
-rw-r--r-- | components/script/timers.rs | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 4572d3221c7..191d3cf6dde 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -257,7 +257,7 @@ impl XMLHttpRequest { let req2 = req.clone(); // TODO: this exists only to make preflight check non-blocking // perhaps should be handled by the resource_loader? - spawn_named("XHR:Cors", proc() { + spawn_named("XHR:Cors".to_owned(), proc() { let response = req2.http_fetch(); chan.send(response); }); @@ -624,7 +624,7 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> { // inflight events queued up in the script task's port. let addr = Trusted::new(self.global.root().r().get_cx(), self, script_chan.clone()); - spawn_named("XHRTask", proc() { + spawn_named("XHRTask".to_owned(), proc() { let _ = XMLHttpRequest::fetch(&mut SyncOrAsync::Async(addr, script_chan), resource_task, load_data, @@ -936,7 +936,7 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> { let oneshot = self.timer.borrow_mut() .oneshot(Duration::milliseconds(timeout as i64)); let terminate_sender = (*self.terminate_sender.borrow()).clone(); - spawn_named("XHR:Timer", proc () { + spawn_named("XHR:Timer".to_owned(), proc () { match oneshot.recv_opt() { Ok(_) => { terminate_sender.map(|s| s.send_opt(TerminateReason::TimedOut)); diff --git a/components/script/timers.rs b/components/script/timers.rs index 9c6ec47ffef..ef86c8ccd13 100644 --- a/components/script/timers.rs +++ b/components/script/timers.rs @@ -17,6 +17,7 @@ use servo_util::str::DOMString; use js::jsval::JSVal; +use std::borrow::ToOwned; use std::cell::Cell; use std::cmp; use std::collections::HashMap; @@ -127,7 +128,7 @@ impl TimerManager { TimerSource::FromWorker if is_interval == IsInterval::Interval => "Worker:SetInterval", TimerSource::FromWindow(_) => "Window:SetTimeout", TimerSource::FromWorker => "Worker:SetTimeout", - }; + }.to_owned(); spawn_named(spawn_name, proc() { let mut tm = tm; let duration = Duration::milliseconds(timeout as i64); |