Instead of exporting lazy getter, export a function that returns the FxAccount
singleton, lazily creating on the first call, and define the lazy getter on the
consumer side that calls the function.
Differential Revision: https://phabricator.services.mozilla.com/D147634
Instead of exporting lazy getter, export a function that returns the FxAccount
singleton, lazily creating on the first call, and define the lazy getter on the
consumer side that calls the function.
Differential Revision: https://phabricator.services.mozilla.com/D147634
This is a rewrite of large portions of RemoteImages. Previously, RemoteImages
just relied on the presence of correctly-names files on disk for its cache. Now
we are keeping proper track of what images we've saved via a JSONFile store.
This removes the need for embedding extensions in image IDs -- images
previously referenced as, e.g., "heart.png" can now be referenced without their
extension e.g., "heart". However, for backwards compatability, image IDs with
extensions will still be accepted, but the extension will be stripped off and
ignored.
Instead, we keep track of the mimetype (as reported by Remote Settings) in our
database, as well as the last time we loaded the image (instead of relying on
the last modified time from the filesystem, which is where we were caching that
information previously).
Additionally, some cleanup has been done to prevent image loading while cleanup
is ocurring and vice versa. All interactions that would modify the database go
through `RemoteImages#withDb`, which executes a closure with the `JSONFile`
instance. This closure is a critical section and multiple closures are
prevented from executing at once.
Differential Revision: https://phabricator.services.mozilla.com/D144593
This is a rewrite of large portions of RemoteImages. Previously, RemoteImages
just relied on the presence of correctly-names files on disk for its cache. Now
we are keeping proper track of what images we've saved via a JSONFile store.
This removes the need for embedding extensions in image IDs -- images
previously referenced as, e.g., "heart.png" can now be referenced without their
extension e.g., "heart". However, for backwards compatability, image IDs with
extensions will still be accepted, but the extension will be stripped off and
ignored.
Instead, we keep track of the mimetype (as reported by Remote Settings) in our
database, as well as the last time we loaded the image (instead of relying on
the last modified time from the filesystem, which is where we were caching that
information previously).
Additionally, some cleanup has been done to prevent image loading while cleanup
is ocurring and vice versa. All interactions that would modify the database go
through `RemoteImages#withDb`, which executes a closure with the `JSONFile`
instance. This closure is a critical section and multiple closures are
prevented from executing at once.
Differential Revision: https://phabricator.services.mozilla.com/D144593
This patch changes the default behaviour of `download()`.
- Previous file-based behaviour was moved to `downloadToDisk()` and `deleteFromDisk()`. Existing consumers were migrated to avoid behaviour change.
- `download()` has now `{useCache: true}` by default, option was dropped, and `deleteCached()` is now `deleteDownloaded()`
Differential Revision: https://phabricator.services.mozilla.com/D141980
This patch changes the default behaviour of `download()`.
- Previous file-based behaviour was moved to `downloadToDisk()` and `deleteFromDisk()`. Existing consumers were migrated to avoid behaviour change.
- `download()` has now `{useCache: true}` by default, option was dropped, and `deleteCached()` is now `deleteDownloaded()`
Differential Revision: https://phabricator.services.mozilla.com/D141980