Files
Jens Stutte c24dce6f5b Bug 1926722 - Refactoring: Make RemoteLazyInputStreamThread's lifecycle more sound. r=dom-storage-reviewers,asuth,xpcom-reviewers,nika
In order to make things clearer, we:
- Use already_AddRefed for Get and GetOrCreate's return, ensuring the AddRef happens under the locked mutex and expecting that callers hold a strong reference until they need it.
- Make mThread const, such that there can never be a situation where we cannot use it as long as we have our RemoteLazyInputStreamThread instance.
- Add thread safety annotions for gRemoteLazyThreadMutex.

We can rely on mThread refusing to work after shutdown, in particular to dispatch runnables, such that we can just delegate most calls without additional checks.

We also remove the previous explicit observer implementation in favor of the simpler RunOnShutdown.

Differential Revision: https://phabricator.services.mozilla.com/D227036
2024-11-07 06:18:52 +00:00
..