Another follow-up from bug 1320533. Based on a cursory look, I think one thing that we need to be careful about is the mWorkerThread->Shutdown() call in DataStorage::Observe(). When sharing a thread between all of our objects, we need a custom way to handle all of the events and prevent further dispatches from that object, which seems relatively straightforward (we can post a runnable to the thread and wait for that to be executed to know all of the previous runnables have run, and setup a member that signals the "don't dispatch more runnables" state).
Maybe just use an nsThreadPool, which enables us to use multiple threads if necessary (not sure how busy DataStorage is), and will handle the "shutdown affects all clients" case?
DataStorage right now in a tri-singleton (as in there's only 3 instances of it) if I'm reading the code correctly, so I don't think that's worth it...
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.