aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/response.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-09-26 01:53:40 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2017-09-26 09:49:10 +0200
commitf87c2a8d7616112ca924e30292db2d244cf87eec (patch)
tree7344afe7ec0ec1ac7d1d13f5385111ee9c4be332 /components/script/dom/response.rs
parent577370746e2ce3da7fa25a20b8e1bbeed319df65 (diff)
downloadservo-f87c2a8d7616112ca924e30292db2d244cf87eec.tar.gz
servo-f87c2a8d7616112ca924e30292db2d244cf87eec.zip
Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>, where Root<T> will be able to handle all the things that need to be rooted that have a stable traceable address that doesn't move for the whole lifetime of the root. Stay tuned.
Diffstat (limited to 'components/script/dom/response.rs')
-rw-r--r--components/script/dom/response.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/response.rs b/components/script/dom/response.rs
index 269803feaa2..a874aac77e6 100644
--- a/components/script/dom/response.rs
+++ b/components/script/dom/response.rs
@@ -11,7 +11,7 @@ use dom::bindings::codegen::Bindings::ResponseBinding::{ResponseMethods, Respons
use dom::bindings::codegen::Bindings::XMLHttpRequestBinding::BodyInit;
use dom::bindings::error::{Error, Fallible};
use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
-use dom::bindings::root::{MutNullableDom, Root};
+use dom::bindings::root::{DomRoot, MutNullableDom};
use dom::bindings::str::{ByteString, USVString};
use dom::globalscope::GlobalScope;
use dom::headers::{Headers, Guard};
@@ -67,12 +67,12 @@ impl Response {
}
// https://fetch.spec.whatwg.org/#dom-response
- pub fn new(global: &GlobalScope) -> Root<Response> {
+ pub fn new(global: &GlobalScope) -> DomRoot<Response> {
reflect_dom_object(box Response::new_inherited(), global, ResponseBinding::Wrap)
}
pub fn Constructor(global: &GlobalScope, body: Option<BodyInit>, init: &ResponseBinding::ResponseInit)
- -> Fallible<Root<Response>> {
+ -> Fallible<DomRoot<Response>> {
// Step 1
if init.status < 200 || init.status > 599 {
return Err(Error::Range(
@@ -139,7 +139,7 @@ impl Response {
}
// https://fetch.spec.whatwg.org/#dom-response-error
- pub fn Error(global: &GlobalScope) -> Root<Response> {
+ pub fn Error(global: &GlobalScope) -> DomRoot<Response> {
let r = Response::new(global);
*r.response_type.borrow_mut() = DOMResponseType::Error;
r.Headers().set_guard(Guard::Immutable);
@@ -148,7 +148,7 @@ impl Response {
}
// https://fetch.spec.whatwg.org/#dom-response-redirect
- pub fn Redirect(global: &GlobalScope, url: USVString, status: u16) -> Fallible<Root<Response>> {
+ pub fn Redirect(global: &GlobalScope, url: USVString, status: u16) -> Fallible<DomRoot<Response>> {
// Step 1
let base_url = global.api_base_url();
let parsed_url = base_url.join(&url.0);
@@ -291,12 +291,12 @@ impl ResponseMethods for Response {
}
// https://fetch.spec.whatwg.org/#dom-response-headers
- fn Headers(&self) -> Root<Headers> {
+ fn Headers(&self) -> DomRoot<Headers> {
self.headers_reflector.or_init(|| Headers::for_response(&self.global()))
}
// https://fetch.spec.whatwg.org/#dom-response-clone
- fn Clone(&self) -> Fallible<Root<Response>> {
+ fn Clone(&self) -> Fallible<DomRoot<Response>> {
// Step 1
if self.is_locked() || self.body_used.get() {
return Err(Error::Type("cannot clone a disturbed response".to_string()));