I was talking to somebody at Mozilla’s recent all-hands meeting in Portland, and in the course of attempting to provide a reasonable answer for “What have you been doing lately?”, I said that I had been doing a lot of reviews, mostly because of my newfound duties as XPCOM module owner. My conversational partner responded with some surprise that people were still modifying code in XPCOM at such a clip that reviews would be a burden. I responded that while the code was not rapidly changing, people were still finding reasons to do significant modifications to XPCOM code, and I mentioned a few recent examples.
But in light of that conversation, it’s good to broadcast some of the work I’ve had the privilege of reviewing this year. I apologize in advance for not citing everybody; in particular, my reviews email folder only goes back to August, so I have a very incomplete record of what I’ve reviewed in the past year. In no particular order:
- Randall Barker has been working on building a standalone WebRTC library, which necessitates building a standalone XPCOM, as our WebRTC code depends on things like XPCOM timers and threads.
- Brian Birtles wrote a series of patches that implemented a version of TimeDuration that uses saturating-esque arithmetic, which is useful for animation code.
- Birunthan Mohanathas wrote a rather large series of patches for completely converting xpcom/ to Gecko style, not all of which are featured in the linked bug. He submitted numerous patches, re-indenting code, renaming arguments, and fixing other style violations, all easily reviewable. xpcom/ is a better place for his work.
- Eric Rahm made some significant changes to how the deadlock detector works, improving its memory usage and redoing how we store callstacks. The upshot here is that the deadlock detector is significantly faster, and no longer requires trace-malloc to provide callstacks.
- Ben Kelly implemented XPCOM streams that perform snappy compression on the data being written to or from them, as part of his ongoing work on Service Workers. We did think about using the stream converter service for this one, but the APIs didn’t match up very nicely with how the streams were actually getting used.
- Mike Hommey wrote a tool to record and replay memory allocations made by Firefox. In the course of doing so, he discovered a nasty infinite loop made possible by using locking primitives that always had to be dynamically allocated. Working around this required writing statically-allocated mutexes and carefully integrating with our file descriptor poisoning that happens during shutdown.
- Ehsan Akhgari discovered that the ReplaceSubstring method of XPCOM’s strings was O(n^2), which caused hangs when using the reftest analyzer. And motivated by wanting to have automated testing for this, he also ported the string tests to run under the GTest unit test framework (along with other tests that have lain dormant for far too long.)
- People also continue to make various tweaks to XPCOM data structures: Kyle Huey and Peter Van der Beken added rvalue reference support to nsTArray. Seth Fowler modified various Auto helpers so they’d work properly with mozilla::Maybe. Nicholas Nethercote fixed nsTArray to use exponential growth when appending to an array.
- Finally, reviewing wouldn’t be reviewing if you didn’t get to review fixes to code that you already reviewed and approved some time ago. Benjamin Smedberg wrote a patch a year ago to annotate out-of-memory callsites in XPCOM with the actual amount of bytes that were being allocated. This worked well enough, but David Major noticed that we sometimes passed the sentinel size of -1 as the actual allocation size, and we didn’t compute the correct sizes for XPCOM string allocations.