This adds enough annotations to get the code building locally for me with
warnings as errors. However, this patch involves ignoring analysis for certain
functions.
My read of the code here is that it involves conditional unlocking. My
understanding is this messes with the static analysis. Since I'm not familiar
with this code, I decided it best I don't update the locking mechanisms, so went
with the current approach.
I'm happy for this patch to be stolen and extended, or superseded, or landed and
then iterated on. Hopefully it's of some use as a starting point.
Differential Revision: https://phabricator.services.mozilla.com/D142771