devtools: improve ID Naming for better readability and context (#35942)

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
atbrakhi 2025-03-13 08:36:54 +01:00 committed by GitHub
parent 7594dc6991
commit eb2ca42824
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 60 additions and 60 deletions

View file

@ -32,7 +32,7 @@ pub(crate) trait Actor: Any + ActorAsAny {
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
id: StreamId,
stream_id: StreamId,
) -> Result<ActorMessageStatus, ()>;
fn name(&self) -> String;
fn cleanup(&self, _id: StreamId) {}
@ -77,9 +77,9 @@ impl ActorRegistry {
}
}
pub(crate) fn cleanup(&self, id: StreamId) {
pub(crate) fn cleanup(&self, stream_id: StreamId) {
for actor in self.actors.values() {
actor.cleanup(id);
actor.cleanup(stream_id);
}
}
@ -170,7 +170,7 @@ impl ActorRegistry {
&mut self,
msg: &Map<String, Value>,
stream: &mut TcpStream,
id: StreamId,
stream_id: StreamId,
) -> Result<(), ()> {
let to = match msg.get("to") {
Some(to) => to.as_str().unwrap(),
@ -184,7 +184,7 @@ impl ActorRegistry {
None => log::warn!("message received for unknown actor \"{}\"", to),
Some(actor) => {
let msg_type = msg.get("type").unwrap().as_str().unwrap();
if actor.handle_message(self, msg_type, msg, stream, id)? !=
if actor.handle_message(self, msg_type, msg, stream, stream_id)? !=
ActorMessageStatus::Processed
{
log::warn!(