mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
34829dfce7
commit
30b6e289e0
7 changed files with 199 additions and 198 deletions
|
@ -74,7 +74,7 @@ impl Serializable {
|
|||
|
||||
/// Message for communication between the constellation and a global managing broadcast channels.
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct BroadcastMsg {
|
||||
pub struct BroadcastChannelMsg {
|
||||
/// The origin of this message.
|
||||
pub origin: ImmutableOrigin,
|
||||
/// The name of the channel.
|
||||
|
@ -83,9 +83,9 @@ pub struct BroadcastMsg {
|
|||
pub data: StructuredSerializedData,
|
||||
}
|
||||
|
||||
impl Clone for BroadcastMsg {
|
||||
fn clone(&self) -> BroadcastMsg {
|
||||
BroadcastMsg {
|
||||
impl Clone for BroadcastChannelMsg {
|
||||
fn clone(&self) -> BroadcastChannelMsg {
|
||||
BroadcastChannelMsg {
|
||||
data: self.data.clone_for_broadcast(),
|
||||
origin: self.origin.clone(),
|
||||
channel_name: self.channel_name.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue