wez@ had a few suggestions to (further) improve Geolocation classes (slightly redacted):
1. I think we should migrate it from Singleton to LazyInstance; they're pretty much equivalent but LazyInstance avoids polluting the interface with Singleton guff.
2. The implementation should be split out into the existing singleton, which callers interact with, and a "core" object which exists only while it is in-use, and holds all the code & state that is run & used on the Geolocation thread. When it goes out of use, you just DeleteSoon that object on the Geolocation thread.
3. It should ideally be initialised with a SequencedTaskRunner, or get one from the browser's SequencedWorkerPool, rather than creating its own dedicated thread.
4. If it must have its own Thread, it should own that as a member, not derive from Thread!
5. MockLocationProvider should be renamed to FakeLocationProvider, since it is a fake, not a mock. The comments on the factory functions should be tidied up, since they're incorrect. I'd also recommend that the factory functions be moved to static-member-functions CreateFoo() of the class itself, and updated to use unique_ptr<>.
Comment 1 by lethalantidote@chromium.org
, Aug 15 2016