mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
devtools: improve ID Naming for better readability and context (#35942)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
parent
7594dc6991
commit
eb2ca42824
7 changed files with 60 additions and 60 deletions
|
@ -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!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue