Skip to content

devtools: Rename WorkerActor variables and add register method#43963

Merged
mukilan merged 1 commit into
servo:mainfrom
thebabalola:devtools/rename-worker-actor
Apr 6, 2026
Merged

devtools: Rename WorkerActor variables and add register method#43963
mukilan merged 1 commit into
servo:mainfrom
thebabalola:devtools/rename-worker-actor

Conversation

@thebabalola

Copy link
Copy Markdown
Contributor

Renames local variable worker to worker_actor in lib.rs and root.rs, following the {}_actor convention for actor struct variables and {}_name for actor name string variables established in #43606.

Also adds a WorkerActor::register() method (part of #43800), replacing the inline struct construction in lib.rs with a consistent pattern pattern matching other actors like ThreadActor and SourceActor.

Changes:

  • actors/worker.rs: Add WorkerActor::register() method
  • actors/root.rs: Rename workerworker_actor in listServiceWorkerRegistrations handler
  • lib.rs: Replace inline struct construction with WorkerActor::register() call

Testing: No testing required, compiles successfully.

Fixes: Part of #43606
Fixes: Part of #43800

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 6, 2026
Comment thread components/devtools/actors/worker.rs Outdated
worker_id,
url,
type_: worker_type,
script_chan: script_sender,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can rename the script_chan field in WorkerActor to script_sender in this PR to be consistent with other actors.

@mukilan mukilan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the PR looks good and can land as it is. I've just mentioned an additional cleanup that I think makes sense to do in this PR.

@servo-highfive servo-highfive added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 6, 2026
@thebabalola thebabalola force-pushed the devtools/rename-worker-actor branch from bb102c4 to 92bdd4e Compare April 6, 2026 14:39
@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Apr 6, 2026
@thebabalola thebabalola force-pushed the devtools/rename-worker-actor branch from 92bdd4e to 0e39e47 Compare April 6, 2026 15:13
Renames local variable `worker` to `worker_actor` in lib.rs and
root.rs, following the `{}_actor` convention for actor struct
variables and `{}_name` for actor name string variables.

Also adds a `WorkerActor::register()` method (part of servo#43800),
replacing the inline struct construction in lib.rs with a
consistent pattern matching other actors like ThreadActor and
SourceActor.

Fixes: Part of servo#43606
Fixes: Part of servo#43800
Signed-off-by: thebabalola <t.babalolajoseph@gmail.com>
@thebabalola thebabalola force-pushed the devtools/rename-worker-actor branch from 0e39e47 to 0a5c003 Compare April 6, 2026 15:28
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 6, 2026
@mukilan mukilan enabled auto-merge April 6, 2026 15:34
@mukilan mukilan added this pull request to the merge queue Apr 6, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 6, 2026
Merged via the queue into servo:main with commit a7870df Apr 6, 2026
30 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants