1
0
Fork 0
fenix/app
Grisha Kruglov eb14532c3c Closes #7450: Lazy storage initialization
Make sure that we actually lazily initialize our storage layers.

With this patch applied, storage layers (history, logins, bookmarks) will be initialized when first
accessed. We will no longer block GeckoEngine init, for example, on waiting for the logins storage
to initialize (which needs to access the costly securePrefStorage).
Similarly, BackgroundServices init will no longer require initialized instances of the storage
components - references to their "lazy wrappers" will suffice.

In practice, this change changes when our storage layers are initialized in the following ways.
Currently, we will initialize everything on startup. This includes loading our megazord, as well.

With this change, init path depends on if the user is signed-into FxA or not.

If user is not an FxA user:
- on startup, none of the storage layers are initialized
- history storage will be initialized once, whenever:
  - first non-customTab page is loaded (access to the HistoryDelegate)
  - first interaction with the awesomebar
  - history UI is accessed
- bookmarks storage will be initialized once, whenever:
  - something is bookmarked, or we need to figure out if something's bookmarked
  - bookmarks UI is accessed
- logins storage will be initialized once, whenever:
  - first page is loaded with a login/password fields that can be autofilled
  - (or some other interaction by GV with the autofill/loginStorage delegates)
  - logins UI is accessed
- all of these storages will be initialized if the user logs into FxA and starts syncing data
  - except, if a storage is not chosen to be synced, it will not be initialized

If user is an FxA user:
- on startup, none of the storage layers are initialized
- sometime shortly after startup is complete, when a sync worker runs in the background, all storage
layers that are enabled to sync will be initialized.

This change also means that we delay loading the megazord until first access (as described above).
2020-03-19 15:46:50 -07:00
..
sampledata For #7092: Add initial Migration UI 2020-01-15 21:41:01 -08:00
src Closes #7450: Lazy storage initialization 2020-03-19 15:46:50 -07:00
.gitignore Initializes Android project 2018-12-07 15:25:38 -05:00
build.gradle Add support for application-services autoPublish local dev workflow. 2020-03-19 10:51:08 +02:00
lint.xml Fixes #1890 - Remove unused strings (#1891) 2019-04-22 11:24:49 -07:00
metrics.yaml For #7295 - Adds more documentation for the installation metrics 2020-02-14 20:56:49 -08:00
pings.yaml For #7295 - Adds more documentation for the installation metrics 2020-02-14 20:56:49 -08:00
proguard-rules.pro For #8949 - Removes old motionlayout code, fixes how shadow is drawn 2020-03-11 17:10:40 -07:00