aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/body.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/body.rs')
-rw-r--r--components/script/body.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/components/script/body.rs b/components/script/body.rs
index 06b864fa4e9..d5a63d7bcf0 100644
--- a/components/script/body.rs
+++ b/components/script/body.rs
@@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-use crate::compartments::{AlreadyInCompartment, InCompartment};
use crate::dom::bindings::cell::Ref;
use crate::dom::bindings::codegen::Bindings::FormDataBinding::FormDataMethods;
use crate::dom::bindings::error::{Error, Fallible};
@@ -14,6 +13,7 @@ use crate::dom::blob::{normalize_type_string, Blob};
use crate::dom::formdata::FormData;
use crate::dom::globalscope::GlobalScope;
use crate::dom::promise::Promise;
+use crate::realms::{AlreadyInRealm, InRealm};
use crate::script_runtime::JSContext;
use js::jsapi::Heap;
use js::jsapi::JSObject;
@@ -52,11 +52,9 @@ pub enum FetchedData {
// https://fetch.spec.whatwg.org/#concept-body-consume-body
#[allow(unrooted_must_root)]
pub fn consume_body<T: BodyOperations + DomObject>(object: &T, body_type: BodyType) -> Rc<Promise> {
- let in_compartment_proof = AlreadyInCompartment::assert(&object.global());
- let promise = Promise::new_in_current_compartment(
- &object.global(),
- InCompartment::Already(&in_compartment_proof),
- );
+ let in_realm_proof = AlreadyInRealm::assert(&object.global());
+ let promise =
+ Promise::new_in_current_realm(&object.global(), InRealm::Already(&in_realm_proof));
// Step 1
if object.get_body_used() || object.is_locked() {