DevTools: worker_id shoud be id & thread for workers should be thread (#36631)

This is part of https://github.com/servo/servo/pull/36562, where I
discovered that we are sending thread as `context` and `id` for worker
is called `worked_id`. In this PR, I have renamed the `worker_id` to
`id` and thread is sent as `thread` and not context. These chages were
tested in #36562

Some logs for context(this logs are from firefox instance)

`worker_id` should be `id`
```
{"_from": "server1.conn0.watcher35", "message": {"from": "server1.conn0.watcher35", "target": {"actor": "server1.conn0.watcher34.process7//workerTarget21/workerTarget5", "consoleActor": "server1.conn0.watcher34.process7//workerTarget21/console2", "id": "f454ea34-c76a-4b6e-a079-43ee3128881e", "name": "", "objectsManagerActor": "server1.conn0.watcher34.process7//workerTarget21/objects-manager4", "relatedDocumentInnerWindowId": 15032385539, "targetType": "worker", "threadActor": "server1.conn0.watcher34.process7//workerTarget21/thread1", "tracerActor": "server1.conn0.watcher34.process7//workerTarget21/tracer3", "traits": {"supportsTopLevelTargetFlag": false}, "type": 0, "url": "http://localhost:8000/Documents/codespace/servo/worker.js"}, "type": "target-available-form"}}
```

Thread should be `thread` and not `context`
```
{"_from": "server1.conn0.watcher35", "message": {"from": "server1.conn0.watcher35", "target": {"actor": "server1.conn0.watcher34.process7//workerTarget21/workerTarget5", "consoleActor": "server1.conn0.watcher34.process7//workerTarget21/console2", "id": "f454ea34-c76a-4b6e-a079-43ee3128881e", "name": "", "objectsManagerActor": "server1.conn0.watcher34.process7//workerTarget21/objects-manager4", "relatedDocumentInnerWindowId": 15032385539, "targetType": "worker", "threadActor": "server1.conn0.watcher34.process7//workerTarget21/thread1", "tracerActor": "server1.conn0.watcher34.process7//workerTarget21/tracer3", "traits": {"supportsTopLevelTargetFlag": false}, "type": 0, "url": "http://localhost:8000/Documents/codespace/servo/worker.js"}, "type": "target-available-form"}}
```


- [x] ./mach build -d does not report any errors
- [x] ./mach test-tidy does not report any errors
- [x] These changes partially implement
https://github.com/servo/servo/issues/36027

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
atbrakhi 2025-04-21 17:43:56 +02:00 committed by GitHub
parent 9a14ad8535
commit 15301df799
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -334,7 +334,7 @@ impl DevtoolsInstance {
assert!(self.pipelines.contains_key(&pipeline_id));
assert!(self.browsing_contexts.contains_key(&browsing_context_id));
let thread = ThreadActor::new(actors.new_name("context"));
let thread = ThreadActor::new(actors.new_name("thread"));
let thread_name = thread.name();
actors.register(Box::new(thread));