GeckoThread.LaunchState now covers the entire GeckoThread lifetime and
not just launch, so it's renamed to GeckoThread.State. More utility
methods are added to check for the current state.
Note that I'm not actually sure where delayLoad and selected are used by
Gecko and thus the side effects of changing them (but I did set the flags
as I'd expect for them to work).
The issue: only by launching GeckoApp (or a subclass) did we specify what kind of DB we wanted. If we don't specify, we get a StubBrowserDB.
The search activity is not a GeckoApp, but it does implicitly access a profile.
The same is true for Sync: a background Sync would eventually cause the CP to touch GeckoProfile to get the profile directory.
Both of these avenues will poison the GeckoProfile cache, storing a profile with a database member that's a StubBrowserDB.
If you subsequently launched the browser you'd get that GeckoProfile instance from the profile cache. StubBrowserDB deliberately returns null for some queries -- such as getTopSites. That causes us to throw here.
The solution I chose: have *GeckoApplication* specify which kind of DB to use, and then have WebappImpl (the only subclass for which we want different behavior) override it.
GeckoView consumers remain unaffected, because they have their own Application class, and so the usual GeckoProfile fallback applies.