Initialize storage after visual completeness

In order to eat the perceived performance costs, we initialize storage
once we're visually complete. This way, we're reducing chances of user performing
a UI action which will trigger storage init and delay said action.
fennec/beta
Grisha Kruglov 4 years ago committed by Grisha Kruglov
parent eb14532c3c
commit e541e10427

@ -151,6 +151,15 @@ open class FenixApplication : LocaleAwareApplication() {
registerActivityLifecycleCallbacks(
PerformanceActivityLifecycleCallbacks(components.performance.visualCompletenessTaskManager)
)
components.performance.visualCompletenessTaskManager.add {
GlobalScope.launch(Dispatchers.IO) {
logger.info("Initializing storage after visual completeness...")
components.core.lazyHistoryStorage.value
components.core.lazyBookmarksStorage.value
components.core.lazyPasswordsStorage.value
}
}
}
// See https://github.com/mozilla-mobile/fenix/issues/7227 for context.

Loading…
Cancel
Save