This commit adds a new crate for bridging Rust Sync engines to Desktop,
and a `mozIBridgedSyncEngine` for accessing the bridge via JS.
Naturally, the bridge is called Golden Gate. 😊 For more information
on how to use it, please see `golden_gate/src/lib.rs`.
Other changes include:
* Ensuring the test Sync server uses UTF-8 for requests and responses.
* Renaming `mozISyncedBookmarksMirrorLogger` to `mozIServicesLogger`,
and moving it into the shared Sync interfaces.
The `BridgedEngine` trait lives in its own crate, called
`golden_gate_traits`, to make it easier to eventually move into a-s.
`Interruptee` and `Interrupted` already exist in a-s, and are
duplicated in this crate for now.
Differential Revision: https://phabricator.services.mozilla.com/D65268
--HG--
extra : moz-landing-system : lando
This commit adds a new crate for bridging Rust Sync engines to Desktop,
and a `mozIBridgedSyncEngine` for accessing the bridge via JS.
Naturally, the bridge is called Golden Gate. 😊 For more information
on how to use it, please see `golden_gate/src/lib.rs`.
Other changes include:
* Ensuring the test Sync server uses UTF-8 for requests and responses.
* Renaming `mozISyncedBookmarksMirrorLogger` to `mozIServicesLogger`,
and moving it into the shared Sync interfaces.
The `BridgedEngine` trait lives in its own crate, called
`golden_gate_traits`, to make it easier to eventually move into a-s.
`Interruptee` and `Interrupted` already exist in a-s, and are
duplicated in this crate for now.
Differential Revision: https://phabricator.services.mozilla.com/D65268
--HG--
extra : moz-landing-system : lando
This commit adds a new crate for bridging Rust Sync engines to Desktop,
and a `mozIBridgedSyncEngine` for accessing the bridge via JS.
Naturally, the bridge is called Golden Gate. 😊 For more information
on how to use it, please see `golden_gate/src/lib.rs`.
Other changes include:
* Ensuring the test Sync server uses UTF-8 for requests and responses.
* Renaming `mozISyncedBookmarksMirrorLogger` to `mozIServicesLogger`,
and moving it into the shared Sync interfaces.
The `BridgedEngine` trait lives in its own crate, called
`golden_gate_traits`, to make it easier to eventually move into a-s.
`Interruptee` and `Interrupted` already exist in a-s, and are
duplicated in this crate for now.
Differential Revision: https://phabricator.services.mozilla.com/D65268
--HG--
extra : moz-landing-system : lando
This restores previous behavior. Will file a bug for the debug-build crash and
so on.
Differential Revision: https://phabricator.services.mozilla.com/D69817
--HG--
extra : moz-landing-system : lando
Mostly a matter of:
rg -l '\->LoadingPrincipal' | xargs sed -i 's/->LoadingPrincipal/->GetLoadingPrincipal/g'
And then clang-format. But I tweaked manually nsHttpChannelAuthProvider (move
the variable where it's used, don't take a useless strong ref),
AddonContentPolicy (move the declaration of the variable to the if condition),
and BackgroundUtils (same).
Differential Revision: https://phabricator.services.mozilla.com/D69828
--HG--
extra : moz-landing-system : lando
Mostly a matter of:
rg -l '\->LoadingPrincipal' | xargs sed -i 's/->LoadingPrincipal/->GetLoadingPrincipal/g'
And then clang-format. But I tweaked manually nsHttpChannelAuthProvider (move
the variable where it's used, don't take a useless strong ref),
AddonContentPolicy (move the declaration of the variable to the if condition),
and BackgroundUtils (same).
Differential Revision: https://phabricator.services.mozilla.com/D69828
--HG--
extra : moz-landing-system : lando
Only 3 callers are using a non-UTF-8 charset as the first parameter.
* MediaDocument.cpp: This does not make sense because the "filename" part of
URLs will always be encoded with UTF-8.
* nsContextMenu.js: This is wrong because "mailto:" URLs don't care about the
document charset.
* Finder.jsm: This caused bug 1623222.
Differential Revision: https://phabricator.services.mozilla.com/D67386
--HG--
extra : moz-landing-system : lando
Expire favicons older than 6 months when:
* they are for permanently redirecting urls, that are unlikely to receive
updated favicons
* they are for urls with refs (often mail, docs) that have a fallback root
favicon for their origin
Expiration happens in chunks, mostly on idle-daily.
Differential Revision: https://phabricator.services.mozilla.com/D65308
--HG--
extra : moz-landing-system : lando
Occasionally, we might try to apply synced bookmarks when a transaction
is already in progress. Consider something like this:
1. The user clicks the star button, which adds a bookmark to the
default folder. Under the hood, this runs a transaction to
completion—`BEGIN`, some `INSERT`s and `UPDATE`s, then `COMMIT`.
2. The `item-added` observer notification kicks off a sync.
3. The user, with the star UI still open, picks a new folder for the
bookmark. This moves the bookmark under the hood.
4. To move the bookmark, we run `BEGIN` on the Places connection's
async thread. Remember, `Sqlite.jsm` runs async statements one at a
time.
5. Concurrently, the merge runnable is scheduled on the async thread.
It's not aware of the `Sqlite.jsm` transaction queue, and doesn't
know that a transaction for the move is already open.
6. The merger tries to open its own transaction with `BEGIN`, fails
noisly, and returns a "cannot start a transaction within a
transaction" error back to the main thread.
7. The move transaction started in (4) runs to completion, updating
the new bookmark's parent and committing the changes.
This is a case of bad timing—retrying the sync once the user finishes
making changes will work—but reports errors in telemetry and logs.
This commit downgrades those to warnings.
Depends on D63732
Differential Revision: https://phabricator.services.mozilla.com/D63734
--HG--
extra : moz-landing-system : lando
Occasionally, we might try to apply synced bookmarks when a transaction
is already in progress. Consider something like this:
1. The user clicks the star button, which adds a bookmark to the
default folder. Under the hood, this runs a transaction to
completion—`BEGIN`, some `INSERT`s and `UPDATE`s, then `COMMIT`.
2. The `item-added` observer notification kicks off a sync.
3. The user, with the star UI still open, picks a new folder for the
bookmark. This moves the bookmark under the hood.
4. To move the bookmark, we run `BEGIN` on the Places connection's
async thread. Remember, `Sqlite.jsm` runs async statements one at a
time.
5. Concurrently, the merge runnable is scheduled on the async thread.
It's not aware of the `Sqlite.jsm` transaction queue, and doesn't
know that a transaction for the move is already open.
6. The merger tries to open its own transaction with `BEGIN`, fails
noisly, and returns a "cannot start a transaction within a
transaction" error back to the main thread.
7. The move transaction started in (4) runs to completion, updating
the new bookmark's parent and committing the changes.
This is a case of bad timing—retrying the sync once the user finishes
making changes will work—but reports errors in telemetry and logs.
This commit downgrades those to warnings.
Depends on D63732
Differential Revision: https://phabricator.services.mozilla.com/D63734
--HG--
extra : moz-landing-system : lando
This patch converts the BMP decoder to use SurfacePipe instead of using
AllocateFrame and Downscaler directly. As a result, it now uses the
accelerated premultiplication path, honours the
SurfaceFlags::NO_PREMULTIPLY_ALPHA flag, and allows for a path forward
to support color management and clipboard better.
Differential Revision: https://phabricator.services.mozilla.com/D64866
--HG--
extra : moz-landing-system : lando
This commit changes `Store::local_row_to_item` to validate local URLs,
and flags items with malformed URLs as invalid. These items are either
replaced with valid remote copies, if they exist, or deleted if not.
Additionally, `BaseBookmarksStore#_calculateIndex` no longer throws
when determining the sort index for an item with an invalid URL.
As an aside, we use the `url` crate to parse URLs. This is the same
crate as used by `MozURL`, which, in turn, backs the JS `URL`
constructor...so URLs should be validated the same way in Rust and JS.
Differential Revision: https://phabricator.services.mozilla.com/D64695
--HG--
extra : moz-landing-system : lando
This covers most cycle collected objects which support weak references, but
not the ones which inherit from a cycle collected class and don't do any cycle
collection on their own.
Differential Revision: https://phabricator.services.mozilla.com/D63962
--HG--
extra : moz-landing-system : lando
The legacy `nsINavBookmarkObserver` notifications use microsecond
timestamps that are rounded to the nearest millisecond, while the
new `bookmark-added` Places event uses milliseconds directly. This
commit fixes that, and also changes the store to use the given
`localTimeSeconds` as the current time, instead of querying the
current system time. This, in turn, lets tests set deterministic
last modified times, which is useful for comparing `lastModified`
timestamps.
Differential Revision: https://phabricator.services.mozilla.com/D62675
--HG--
extra : moz-landing-system : lando
The legacy `nsINavBookmarkObserver` notifications use microsecond
timestamps that are rounded to the nearest millisecond, while the
new `bookmark-added` Places event uses milliseconds directly. This
commit fixes that, and also changes the store to use the given
`localTimeSeconds` as the current time, instead of querying the
current system time. This, in turn, lets tests set deterministic
last modified times, which is useful for comparing `lastModified`
timestamps.
Differential Revision: https://phabricator.services.mozilla.com/D62675
--HG--
extra : moz-landing-system : lando