Sometimes IPDL files have preprocessing directives in them for good reasons. I understand. But searchfox didn't, possibly because of a long-held grudge over the use of preprocessor directives in JS and even HTML. Or maybe searchfox is just a pile of deterministic code and it turns out parsers for languages that don't involve preprocessors can break when you feed them something with preprocessor directives in them all of a sudden? Who's to say?
Either way, searchfox now just pretends that preprocessor directives in IPDL don't exist and the result is that searchfox now understands https://searchfox.org/mozilla-central/source/dom/ipc/PContent.ipdl. While this is very exciting on its own, what's ever very-er exciting is that searchfox's pre-alpha diagramming functionality can then understand and follow functions calls through Send/Recv pairs on PContent. For example, who calls nsIIOService::SetOffline? The diagram at https://searchfox.org/mozilla-central/query/default?q=calls-to%3A%27nsIIOService%3A%3ASetOffline%27%20depth%3A4 knows[0], traversing 2 pairs of IPC calls! And the even pre-alpha-er diagram at https://asuth.searchfox.org/mozilla-central/query/default?q=calls-to%3A%27nsIIOService%3A%3ASetOffline%27%20depth%3A4 knows the same thing with more panache[1][2]!
Andrew
0: If you would like to see the option to use diagrams in your
searchfox context menu, go to
https://searchfox.org/mozilla-central/pages/settings.html and
change either the "default feature gate" to "alpha" or the
"diagramming feature gate" to "alpha".
1: More important than panache, as described at https://mozilla.social/@asutherland/111165928602692176 the changes on that branch include fundamental improvements to the data model that should allow for the diagrams to be made accessible to screen-readers. Also, if you would like even more panache and for your system fans to potentially spin up as your system is brought to its knees due to ill-conceived and excessive use of SVG filters, open up devtools and run `blurrifyDiagram()`!
2: But they both
seem to be experiencing some weird asymmetry between
graphviz's font sizing on the server when generating the SVG
layout and the font I'm using in Firefox. It seems like
graphviz is using a font for sizing that involves a ligature
on "ff" which is not being used in the browser, causing text
to run out the side of their containing nodes. The current
best workaround is to avoid looking at code that involves
the word "offline". If you're interested in seeing the
underlying dot because you would like to help debug such
things, it's possible to add `graph-format:raw-dot` to
queries like so:
https://asuth.searchfox.org/mozilla-central/query/default?q=calls-to%3A%27nsIIOService%3A%3ASetOffline%27+depth%3A4+graph-format%3Araw-dot