mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Async XHR GET with basic response header support
This commit is contained in:
parent
90a0bcfa78
commit
533fab46f9
8 changed files with 253 additions and 51 deletions
|
@ -41,6 +41,7 @@
|
|||
|
||||
use dom::bindings::utils::{Reflector, Reflectable, cx_for_dom_object};
|
||||
use dom::node::Node;
|
||||
use dom::xmlhttprequest::{XMLHttpRequest, TrustedXHRAddress};
|
||||
use js::jsapi::{JSObject, JS_AddObjectRoot, JS_RemoveObjectRoot};
|
||||
use layout_interface::TrustedNodeAddress;
|
||||
use script_task::StackRoots;
|
||||
|
@ -141,6 +142,15 @@ impl JS<Node> {
|
|||
}
|
||||
}
|
||||
|
||||
impl JS<XMLHttpRequest> {
|
||||
pub unsafe fn from_trusted_xhr_address(inner: TrustedXHRAddress) -> JS<XMLHttpRequest> {
|
||||
let TrustedXHRAddress(addr) = inner;
|
||||
JS {
|
||||
ptr: RefCell::new(addr as *mut XMLHttpRequest)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Reflectable> JS<T> {
|
||||
/// Create a new JS-owned value wrapped from a raw Rust pointer.
|
||||
pub unsafe fn from_raw(raw: *mut T) -> JS<T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue