devtools: Default implementation for handle_message (#41076)

Some cleanup to avoid having to specify an empty `handle_message` method
if it is not implemented or not necessary. Removed the TODOs from
Environment and Pause since they don't respond to any message.

Testing: This patch doesn't change behaviour.

Signed-off-by: eri <eri@igalia.com>
This commit is contained in:
eri
2025-12-05 14:56:19 +01:00
committed by GitHub
parent 0ce97201fd
commit 0358619801
6 changed files with 12 additions and 78 deletions

View File

@@ -3,11 +3,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use serde::Serialize;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
use crate::actor::{Actor, ActorRegistry};
#[derive(Serialize)]
pub struct ObjectPreview {
@@ -39,17 +36,9 @@ impl Actor for ObjectActor {
fn name(&self) -> String {
self.name.clone()
}
fn handle_message(
&self,
_request: ClientRequest,
_: &ActorRegistry,
_: &str,
_: &Map<String, Value>,
_: StreamId,
) -> Result<(), ActorError> {
// TODO: Handle enumSymbols for console object inspection
Err(ActorError::UnrecognizedPacketType)
}
// TODO: Handle messages
// https://searchfox.org/firefox-main/source/devtools/shared/specs/object.js
}
impl ObjectActor {