Refactor constellation broadcast channel (#38077)

- Move the 2 hash maps used to manage channels in their own struct.
- The constellation is still in charge of origin checks since it holds
the pipeline information required.
- BroadcastMsg is renamed to BroadcastChannelMsg for consistency.


Testing: covered by existing tests.
Fixes: #38060

Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
webbeef 2025-07-15 06:57:05 -07:00 committed by GitHub
parent 34829dfce7
commit 30b6e289e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 199 additions and 198 deletions

View file

@ -4,7 +4,7 @@
use std::cell::Cell;
use constellation_traits::BroadcastMsg;
use constellation_traits::BroadcastChannelMsg;
use dom_struct::dom_struct;
use js::rust::{HandleObject, HandleValue};
use uuid::Uuid;
@ -89,7 +89,7 @@ impl BroadcastChannelMethods<crate::DomTypeHolder> for BroadcastChannel {
let global = self.global();
let msg = BroadcastMsg {
let msg = BroadcastChannelMsg {
origin: global.origin().immutable().clone(),
channel_name: self.Name().to_string(),
data,