Files
servo/components/devtools/actors/pause.rs
eri fdd49e6da3 devtools: Pause actor boilerplate (#40786)
Prequisite for implementing pausing in the debugger. This will be part
of the `ThreadActor` response to `interrupt`. I decided to split the
change in multiple patches since it is quite big. Continuation of
#38824.

Testing: Deferred until the pause is fully implemented.
Fixes: Part of #36027.

Signed-off-by: eri <eri@igalia.com>
2025-11-22 09:23:45 +00:00

36 lines
1020 B
Rust

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
// TODO: Remove once the actor is used.
#[allow(dead_code)]
/// Referenced by `ThreadActor` when replying to `interupt` messages.
/// <https://searchfox.org/firefox-main/source/devtools/server/actors/thread.js#1699>
pub struct PauseActor {
pub name: String,
}
impl Actor for PauseActor {
fn name(&self) -> String {
self.name.clone()
}
fn handle_message(
&self,
_request: ClientRequest,
_registry: &ActorRegistry,
_msg_type: &str,
_msg: &Map<String, Value>,
_id: StreamId,
) -> Result<(), ActorError> {
// TODO: Handle messages.
Err(ActorError::UnrecognizedPacketType)
}
}