2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

[fenix] Close https://github.com/mozilla-mobile/fenix/issues/26320: Make Nimbus first-startup comments clear in FenixApplication

This commit is contained in:
Jonathan Almeida 2022-11-21 11:20:37 -05:00 committed by mergify[bot]
parent a9b865b019
commit a47b4b3c74

View File

@ -131,16 +131,9 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
return return
} }
// We can initialize Nimbus before Glean because Glean will queue messages // DO NOT ADD ANYTHING ABOVE HERE.
// before it's initialized.
initializeNimbus()
// We need to always initialize Glean and do it early here.
initializeGlean()
setupInMainProcessOnly() setupInMainProcessOnly()
// DO NOT ADD ANYTHING UNDER HERE.
downloadWallpapers()
// DO NOT MOVE ANYTHING BELOW THIS elapsedRealtimeNanos CALL. // DO NOT MOVE ANYTHING BELOW THIS elapsedRealtimeNanos CALL.
val stop = SystemClock.elapsedRealtimeNanos() val stop = SystemClock.elapsedRealtimeNanos()
@ -198,9 +191,20 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
@CallSuper @CallSuper
open fun setupInMainProcessOnly() { open fun setupInMainProcessOnly() {
// ⚠️ DO NOT ADD ANYTHING ABOVE THIS LINE.
// Especially references to the engine/BrowserStore which can alter the app initialization.
// See: https://github.com/mozilla-mobile/fenix/issues/26320
//
// We can initialize Nimbus before Glean because Glean will queue messages
// before it's initialized.
initializeNimbus()
ProfilerMarkerFactProcessor.create { components.core.engine.profiler }.register() ProfilerMarkerFactProcessor.create { components.core.engine.profiler }.register()
run { run {
// We need to always initialize Glean and do it early here.
initializeGlean()
// Attention: Do not invoke any code from a-s in this scope. // Attention: Do not invoke any code from a-s in this scope.
val megazordSetup = finishSetupMegazord() val megazordSetup = finishSetupMegazord()
@ -246,6 +250,8 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
initVisualCompletenessQueueAndQueueTasks() initVisualCompletenessQueueAndQueueTasks()
ProcessLifecycleOwner.get().lifecycle.addObserver(TelemetryLifecycleObserver(components.core.store)) ProcessLifecycleOwner.get().lifecycle.addObserver(TelemetryLifecycleObserver(components.core.store))
downloadWallpapers()
} }
@OptIn(DelicateCoroutinesApi::class) // GlobalScope usage @OptIn(DelicateCoroutinesApi::class) // GlobalScope usage