diff options
author | Josh Matthews <josh@joshmatthews.net> | 2025-01-18 16:36:15 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-18 21:36:15 +0000 |
commit | 875e3870049d2523ec349724d692a11665562d40 (patch) | |
tree | 22f6c6bc078bdb1f44567d4bc99d9b0450986309 /components/script/dom/readablestreamdefaultcontroller.rs | |
parent | 1bd34a578117fdefb8ec20e5cbe49b38dd466c5b (diff) | |
download | servo-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/dom/readablestreamdefaultcontroller.rs')
-rw-r--r-- | components/script/dom/readablestreamdefaultcontroller.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/components/script/dom/readablestreamdefaultcontroller.rs b/components/script/dom/readablestreamdefaultcontroller.rs index 22e724360d8..1b627a90558 100644 --- a/components/script/dom/readablestreamdefaultcontroller.rs +++ b/components/script/dom/readablestreamdefaultcontroller.rs @@ -37,7 +37,7 @@ use crate::script_runtime::{CanGc, JSContext, JSContext as SafeJSContext}; /// The fulfillment handler for /// <https://streams.spec.whatwg.org/#readable-stream-default-controller-call-pull-if-needed> #[derive(Clone, JSTraceable, MallocSizeOf)] -#[allow(crown::unrooted_must_root)] +#[cfg_attr(crown, allow(crown::unrooted_must_root))] struct PullAlgorithmFulfillmentHandler { #[ignore_malloc_size_of = "Trusted are hard"] controller: Trusted<ReadableStreamDefaultController>, @@ -66,7 +66,7 @@ impl Callback for PullAlgorithmFulfillmentHandler { /// The rejection handler for /// <https://streams.spec.whatwg.org/#readable-stream-default-controller-call-pull-if-needed> #[derive(Clone, JSTraceable, MallocSizeOf)] -#[allow(crown::unrooted_must_root)] +#[cfg_attr(crown, allow(crown::unrooted_must_root))] struct PullAlgorithmRejectionHandler { #[ignore_malloc_size_of = "Trusted are hard"] controller: Trusted<ReadableStreamDefaultController>, @@ -86,7 +86,7 @@ impl Callback for PullAlgorithmRejectionHandler { /// The fulfillment handler for /// <https://streams.spec.whatwg.org/#dom-underlyingsource-start> #[derive(Clone, JSTraceable, MallocSizeOf)] -#[allow(crown::unrooted_must_root)] +#[cfg_attr(crown, allow(crown::unrooted_must_root))] struct StartAlgorithmFulfillmentHandler { #[ignore_malloc_size_of = "Trusted are hard"] controller: Trusted<ReadableStreamDefaultController>, @@ -109,7 +109,7 @@ impl Callback for StartAlgorithmFulfillmentHandler { /// The rejection handler for /// <https://streams.spec.whatwg.org/#dom-underlyingsource-start> #[derive(Clone, JSTraceable, MallocSizeOf)] -#[allow(crown::unrooted_must_root)] +#[cfg_attr(crown, allow(crown::unrooted_must_root))] struct StartAlgorithmRejectionHandler { #[ignore_malloc_size_of = "Trusted are hard"] controller: Trusted<ReadableStreamDefaultController>, @@ -128,7 +128,7 @@ impl Callback for StartAlgorithmRejectionHandler { /// <https://streams.spec.whatwg.org/#value-with-size> #[derive(JSTraceable)] -#[crown::unrooted_must_root_lint::must_root] +#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)] pub(crate) struct ValueWithSize { value: Box<Heap<JSVal>>, size: f64, @@ -136,7 +136,7 @@ pub(crate) struct ValueWithSize { /// <https://streams.spec.whatwg.org/#value-with-size> #[derive(JSTraceable)] -#[crown::unrooted_must_root_lint::must_root] +#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)] pub(crate) enum EnqueuedValue { /// A value enqueued from Rust. Native(Box<[u8]>), @@ -193,7 +193,7 @@ fn is_non_negative_number(value: &EnqueuedValue) -> bool { /// <https://streams.spec.whatwg.org/#queue-with-sizes> #[derive(Default, JSTraceable, MallocSizeOf)] -#[crown::unrooted_must_root_lint::must_root] +#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)] pub(crate) struct QueueWithSizes { #[ignore_malloc_size_of = "EnqueuedValue::Js"] queue: VecDeque<EnqueuedValue>, @@ -213,7 +213,7 @@ impl QueueWithSizes { } /// <https://streams.spec.whatwg.org/#enqueue-value-with-size> - #[allow(crown::unrooted_must_root)] + #[cfg_attr(crown, allow(crown::unrooted_must_root))] fn enqueue_value_with_size(&mut self, value: EnqueuedValue) -> Result<(), Error> { // If ! IsNonNegativeNumber(size) is false, throw a RangeError exception. if !is_non_negative_number(&value) { @@ -300,7 +300,7 @@ pub(crate) struct ReadableStreamDefaultController { } impl ReadableStreamDefaultController { - #[allow(crown::unrooted_must_root)] + #[cfg_attr(crown, allow(crown::unrooted_must_root))] fn new_inherited( global: &GlobalScope, underlying_source_type: UnderlyingSourceType, @@ -326,7 +326,7 @@ impl ReadableStreamDefaultController { } } - #[allow(crown::unrooted_must_root)] + #[cfg_attr(crown, allow(crown::unrooted_must_root))] pub(crate) fn new( global: &GlobalScope, underlying_source: UnderlyingSourceType, |