mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Make async XMLHttpRequest requests use async network events.
This commit is contained in:
parent
7517aac9e9
commit
5c7be5c9c3
4 changed files with 283 additions and 13 deletions
|
@ -16,6 +16,7 @@ use std::cell::{BorrowState, RefCell, Ref, RefMut};
|
|||
///
|
||||
/// This extends the API of `core::cell::RefCell` to allow unsafe access in
|
||||
/// certain situations, with dynamic checking in debug builds.
|
||||
#[derive(Clone)]
|
||||
pub struct DOMRefCell<T> {
|
||||
value: RefCell<T>,
|
||||
}
|
||||
|
|
|
@ -207,6 +207,16 @@ impl<T: JSTraceable> JSTraceable for Option<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: JSTraceable, U: JSTraceable> JSTraceable for Result<T, U> {
|
||||
#[inline]
|
||||
fn trace(&self, trc: *mut JSTracer) {
|
||||
match *self {
|
||||
Ok(ref inner) => inner.trace(trc),
|
||||
Err(ref inner) => inner.trace(trc),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<K,V,S> JSTraceable for HashMap<K, V, S>
|
||||
where K: Hash + Eq + JSTraceable,
|
||||
V: JSTraceable,
|
||||
|
@ -297,6 +307,12 @@ impl JSTraceable for Box<LayoutRPC+'static> {
|
|||
}
|
||||
}
|
||||
|
||||
impl JSTraceable for () {
|
||||
#[inline]
|
||||
fn trace(&self, _trc: *mut JSTracer) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Holds a set of vectors that need to be rooted
|
||||
pub struct RootedCollectionSet {
|
||||
set: Vec<HashSet<*const RootedVec<()>>>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue