Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions components/devtools/actors/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ pub(crate) struct WatcherActor {
name: String,
pub browsing_context_name: String,
network_parent_name: String,
target_configuration: String,
target_configuration_name: String,
thread_configuration_name: String,
breakpoint_list_name: String,
session_context: SessionContext,
Expand Down Expand Up @@ -406,7 +406,7 @@ impl Actor for WatcherActor {
let msg = GetTargetConfigurationActorReply {
from: self.name(),
configuration: registry
.encode::<TargetConfigurationActor, _>(&self.target_configuration),
.encode::<TargetConfigurationActor, _>(&self.target_configuration_name),
};
request.reply_final(&msg)?
},
Expand Down Expand Up @@ -445,8 +445,7 @@ impl WatcherActor {
session_context: SessionContext,
) -> String {
let network_parent_name = NetworkParentActor::register(registry);
let target_configuration =
TargetConfigurationActor::new(registry.new_name::<TargetConfigurationActor>());
let target_configuration_name = TargetConfigurationActor::register(registry);
let thread_configuration_name = ThreadConfigurationActor::register(registry);
let breakpoint_list_name =
BreakpointListActor::register(registry, browsing_context_name.clone());
Expand All @@ -456,14 +455,12 @@ impl WatcherActor {
name: name.clone(),
browsing_context_name,
network_parent_name,
target_configuration: target_configuration.name(),
target_configuration_name,
thread_configuration_name,
breakpoint_list_name,
session_context,
};

registry.register(target_configuration);

registry.register::<Self>(actor);

name
Expand Down
11 changes: 7 additions & 4 deletions components/devtools/actors/watcher/target_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ impl Actor for TargetConfigurationActor {
}

impl TargetConfigurationActor {
pub fn new(name: String) -> Self {
Self {
name,
pub fn register(registry: &ActorRegistry) -> String {
let name = registry.new_name::<Self>();
let actor = Self {
name: name.clone(),
configuration: HashMap::new(),
supported_options: HashMap::from([
("cacheDisabled", false),
Expand All @@ -128,7 +129,9 @@ impl TargetConfigurationActor {
("tracerOptions", false),
("useSimpleHighlightersForReducedMotion", false),
]),
}
};
registry.register::<Self>(actor);
name
}
}

Expand Down
Loading