forked from mozilla/application-services
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap the autofill implementation in an Arc<> to help the sync manager.
This patch works-around the lack of the functionlity described in mozilla/uniffi-rs#417. In short, it splits the store into 2 parts - the uniffi-exposed "wrapper" and the actual implementation. This "wrapper" wraps the implementation in an `Arc<>`, so that it can hand a clone of this `Arc<>` to the sync manager, so that it can construct sync engines, causing us to end up with multiple references to the `Store` being alive but without any being actual `&` references. The database itself continues to be wrapped in a `Mutex<>` It also makes some changes in the sync manager, really just enough to convince me that it will work - there will be plenty of other places that will need similar treatment. I chose to use the `SyncEngine` trait exclusively there, which I think makes sense because ideally we'd use that trait *everywhere* to avoid the Sync Manager knowing about the implementation (but it would still require it to link to all those crates, so that's just a code-simplicity issue)
- Loading branch information
Showing
11 changed files
with
208 additions
and
61 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.