Repository navigation
DevTools: Display tabs and processes - #32475
Conversation
Co-authored-by: fabricedesre <[email protected]>
| .map(|target| { | ||
| registry | ||
| .find::<TabDescriptorActor>(target) | ||
| .encodable(registry, true) |
There was a problem hiding this comment.
Why encode here, rather than when we find the actual tab we want to send back?
There was a problem hiding this comment.
I did it this way since TabDescriptorActorMsg contains the broswerId, but TabDescriptorActor doesn't, and we need to filter them by that, I thought of doing the conversion beforehand, but I can absolutely try to do it other way.
|
And you are correct—we have not prioritized any kind if automated testing for the devtools server implementation. |
mrobinson
left a comment
There was a problem hiding this comment.
Great stuff! Just a couple small nits to help gradually improve the devtools code:
| }; | ||
| let _ = stream.write_json_packet(&reply); | ||
| ActorMessageStatus::Processed | ||
| if let Some(serde_json::Value::Number(browserId)) = msg.get("browserId") { |
There was a problem hiding this comment.
Would it be possible to move this code into a function in order to use an early return pattern and avoid some indentation?
There was a problem hiding this comment.
Absolutely, how about now? I used let else to further reduce indentation but I can change it if another pattern is preferred. I am also not sure about the name get_tab_msg_by_browser_id but I couldn't think of one that was shorter but still descriptive, any suggestion is welcome.
Co-authored-by: Martin Robinson <[email protected]>
Following the work of @fabricedesre and cleaning some things a bit, this PR updates the messages sent from Servo to the DevTools server so that Tabs and Processes can be shown again in the main view.
Note that tab inspection doesn't work yet (that's the next step!), as a Watcher Actor needs to be implemented.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors./mach run --devtools=6080and connecting viaabout:debuggingin Firefox. If there is a way to write tests please let me know.