aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/body.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2025-01-18 16:36:15 -0500
committerGitHub <noreply@github.com>2025-01-18 21:36:15 +0000
commit875e3870049d2523ec349724d692a11665562d40 (patch)
tree22f6c6bc078bdb1f44567d4bc99d9b0450986309 /components/script/body.rs
parent1bd34a578117fdefb8ec20e5cbe49b38dd466c5b (diff)
downloadservo-875e3870049d2523ec349724d692a11665562d40.tar.gz
servo-875e3870049d2523ec349724d692a11665562d40.zip
script: Feature-gate all crown support. (#35055)
* script: Feature-gate all crown support. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Use cfg(crown) instead of a cargo feature. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'components/script/body.rs')
-rw-r--r--components/script/body.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/body.rs b/components/script/body.rs
index 5f02a599e77..e8e72913df9 100644
--- a/components/script/body.rs
+++ b/components/script/body.rs
@@ -267,7 +267,7 @@ impl TransmitBodyConnectHandler {
/// The handler of read promises of body streams used in
/// <https://fetch.spec.whatwg.org/#concept-request-transmit-body>.
#[derive(Clone, JSTraceable, MallocSizeOf)]
-#[crown::unrooted_must_root_lint::must_root]
+#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
struct TransmitBodyPromiseHandler {
#[ignore_malloc_size_of = "Channels are hard"]
#[no_trace]
@@ -605,7 +605,7 @@ impl Callback for ConsumeBodyPromiseRejectionHandler {
impl js::gc::Rootable for ConsumeBodyPromiseHandler {}
#[derive(Clone, JSTraceable, MallocSizeOf)]
-#[crown::unrooted_must_root_lint::must_root]
+#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
/// The promise handler used to consume the body,
/// <https://fetch.spec.whatwg.org/#concept-body-consume-body>
struct ConsumeBodyPromiseHandler {
@@ -645,7 +645,7 @@ impl ConsumeBodyPromiseHandler {
impl Callback for ConsumeBodyPromiseHandler {
/// Continuing Step 4 of <https://fetch.spec.whatwg.org/#concept-body-consume-body>
/// Step 3 of <https://fetch.spec.whatwg.org/#concept-read-all-bytes-from-readablestream>.
- #[allow(crown::unrooted_must_root)]
+ #[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn callback(&self, cx: JSContext, v: HandleValue, _realm: InRealm, can_gc: CanGc) {
let stream = self
.stream
@@ -711,7 +711,7 @@ impl Callback for ConsumeBodyPromiseHandler {
}
// https://fetch.spec.whatwg.org/#concept-body-consume-body
-#[allow(crown::unrooted_must_root)]
+#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn consume_body<T: BodyMixin + DomObject>(
object: &T,
body_type: BodyType,