mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
register source_actor in source and not in handle_script
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
parent
66c360d361
commit
f237769a11
2 changed files with 5 additions and 9 deletions
|
@ -86,11 +86,7 @@ impl SourceActor {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new_source(
|
||||
actors: &mut ActorRegistry,
|
||||
url: &ServoUrl,
|
||||
content: String,
|
||||
) -> (SourceActor, String) {
|
||||
pub fn new_source(actors: &mut ActorRegistry, url: &ServoUrl, content: String) -> String {
|
||||
let source_actor_name = actors.new_name("source");
|
||||
|
||||
// this can do better, we should find a way to identify content_type
|
||||
|
@ -102,8 +98,9 @@ impl SourceActor {
|
|||
.to_string();
|
||||
|
||||
let source_actor = SourceActor::new(source_actor_name.clone(), content, content_type);
|
||||
actors.register(Box::new(source_actor));
|
||||
|
||||
(source_actor, source_actor_name)
|
||||
source_actor_name
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -514,9 +514,8 @@ impl DevtoolsInstance {
|
|||
fn handle_script_source_info(&mut self, pipeline_id: PipelineId, source_info: SourceInfo) {
|
||||
let mut actors = self.actors.lock().unwrap();
|
||||
|
||||
let (source_actor, source_actor_name) =
|
||||
let source_actor_name =
|
||||
SourceActor::new_source(&mut actors, &source_info.url, source_info.content.clone());
|
||||
actors.register(Box::new(source_actor));
|
||||
|
||||
if let Some(worker_id) = source_info.worker_id {
|
||||
let Some(worker_actor_name) = self.actor_workers.get(&worker_id) else {
|
||||
|
@ -542,7 +541,7 @@ impl DevtoolsInstance {
|
|||
>>>>>>> 2fbcdac63d6 (fmt)
|
||||
|
||||
let source = SourceData {
|
||||
actor: source_actor_name.clone(),
|
||||
actor: source_actor_name,
|
||||
url: source_info.url.to_string(),
|
||||
is_black_boxed: false,
|
||||
source_content: source_info.content,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue