mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
BroadcastChannel: cleanup routers when closing tabs (#38046)
BroadcastChannel uses 2 hash maps in the constellation and they were not kept properly in sync. Also fixed a logic error where `Option<HashMap<...>>` was not considered empty when being `None`. Testing: These warnings should not happen anymore: [2025-07-14T03:54:22Z WARN constellation::constellation] No sender for broadcast router: (4,1) [2025-07-14T03:33:59Z WARN constellation_traits::structured_data] Attempt to broadcast structured serialized data including ImageBitmap (should never happen). [2025-07-14T03:33:59Z WARN constellation_traits::structured_data] Attempt to broadcast structured serialized data including MessagePort (should never happen). [2025-07-14T03:33:59Z WARN constellation_traits::structured_data] Attempt to broadcast structured serialized data including OffscreenCanvas (should never happen). [2025-07-14T03:33:59Z WARN constellation_traits::structured_data] Attempt to broadcast structured serialized data including ReadableStream (should never happen). [2025-07-14T03:33:59Z WARN constellation_traits::structured_data] Attempt to broadcast structured serialized data including WritableStream (should never happen). [2025-07-14T03:33:59Z WARN constellation_traits::structured_data] Attempt to broadcast structured serialized data including TransformStream (should never happen). Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
5bc3c3088a
commit
677184a0e6
2 changed files with 7 additions and 1 deletions
|
@ -47,7 +47,7 @@ pub struct StructuredSerializedData {
|
|||
impl StructuredSerializedData {
|
||||
fn is_empty(&self, val: Transferrable) -> bool {
|
||||
fn is_field_empty<K, V>(field: &Option<HashMap<K, V>>) -> bool {
|
||||
field.as_ref().is_some_and(|h| h.is_empty())
|
||||
field.as_ref().is_none_or(|h| h.is_empty())
|
||||
}
|
||||
match val {
|
||||
Transferrable::ImageBitmap => is_field_empty(&self.transferred_image_bitmaps),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue