mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Support connecting to worker globals from remote devtools.
This commit is contained in:
parent
bce4ec5b70
commit
565e9432c6
13 changed files with 340 additions and 144 deletions
|
@ -10,6 +10,7 @@ use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
|||
use crate::actors::browsing_context::{BrowsingContextActor, BrowsingContextActorMsg};
|
||||
use crate::actors::device::DeviceActor;
|
||||
use crate::actors::performance::PerformanceActor;
|
||||
use crate::actors::worker::{WorkerActor, WorkerMsg};
|
||||
use crate::protocol::{ActorDescription, JsonPacketStream};
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
|
@ -72,11 +73,6 @@ struct ListWorkersReply {
|
|||
workers: Vec<WorkerMsg>,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct WorkerMsg {
|
||||
id: u32,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct ListServiceWorkerRegistrationsReply {
|
||||
from: String,
|
||||
|
@ -110,6 +106,7 @@ struct GetProcessResponse {
|
|||
|
||||
pub struct RootActor {
|
||||
pub tabs: Vec<String>,
|
||||
pub workers: Vec<String>,
|
||||
pub performance: String,
|
||||
pub device: String,
|
||||
pub preference: String,
|
||||
|
@ -203,7 +200,11 @@ impl Actor for RootActor {
|
|||
"listWorkers" => {
|
||||
let reply = ListWorkersReply {
|
||||
from: self.name(),
|
||||
workers: vec![],
|
||||
workers: self
|
||||
.workers
|
||||
.iter()
|
||||
.map(|name| registry.find::<WorkerActor>(name).encodable())
|
||||
.collect(),
|
||||
};
|
||||
stream.write_json_packet(&reply);
|
||||
ActorMessageStatus::Processed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue