mirror of
https://github.com/servo/servo.git
synced 2025-07-19 13:23:46 +01:00
DevTools: Improve resource_available
to handle multiple connections (#36933)
This patch improves the `resource_available` trait to handle multiple connections. In this patch we also remove the redundant `resource_available` from worker actor Testing: Existing tests in DevTools already tests for this. We do not need to add new test Fixes: part of #36027 Signed-off-by: atbrakhi <atbrakhi@igalia.com> Co-authored-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
parent
e5347eceac
commit
2aaf9695df
6 changed files with 51 additions and 62 deletions
|
@ -252,6 +252,7 @@ impl ConsoleActor {
|
|||
page_error: PageError,
|
||||
id: UniqueId,
|
||||
registry: &ActorRegistry,
|
||||
stream: &mut TcpStream,
|
||||
) {
|
||||
self.cached_events
|
||||
.borrow_mut()
|
||||
|
@ -262,7 +263,11 @@ impl ConsoleActor {
|
|||
if let Root::BrowsingContext(bc) = &self.root {
|
||||
registry
|
||||
.find::<BrowsingContextActor>(bc)
|
||||
.resource_available(PageErrorWrapper { page_error }, "error-message".into())
|
||||
.resource_available(
|
||||
PageErrorWrapper { page_error },
|
||||
"error-message".into(),
|
||||
stream,
|
||||
)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -272,6 +277,7 @@ impl ConsoleActor {
|
|||
console_message: ConsoleMessage,
|
||||
id: UniqueId,
|
||||
registry: &ActorRegistry,
|
||||
stream: &mut TcpStream,
|
||||
) {
|
||||
let log_message: ConsoleLog = console_message.into();
|
||||
self.cached_events
|
||||
|
@ -283,7 +289,7 @@ impl ConsoleActor {
|
|||
if let Root::BrowsingContext(bc) = &self.root {
|
||||
registry
|
||||
.find::<BrowsingContextActor>(bc)
|
||||
.resource_available(log_message, "console-message".into())
|
||||
.resource_available(log_message, "console-message".into(), stream)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue