Firefox Application Services
Перейти к файлу
Ben Dean-Kawamura 91d0bab23e Adding shutdown support to sql-support
When the user wants to shutdown the application, we should:
  - Interrupt all current `SqlInterruptScope`s
  - Interrupt all future `SqlInterruptScope`s when they're created.

The nice thing about this approach is that it didn't require invasive
changes in places to support it.  The main new requirement was we need
to have a way to get a `Weak<AsRef<SqlInterruptHandler>>` for each
database.  In order to support that, I needed to:

 - For the read/write and read-only connections: have `PlacesConnection`
   store an `SqlInterruptHandler` and implement `AsRef`.
 - For the sync connection: Added struct that wraps the
   `Mutex<PlacesDb>` and also stores a `SqlInterruptHandler` and
   implements `AsRef`.

Updated `places-utils` so that ctrl-c starts shutdown mode.
2022-02-02 10:01:30 -05:00
.cargo Make `cargo uniffi-bindgen` alias work when executed from a crate. 2021-06-18 05:09:51 +00:00
.circleci Reverted the supported Xcode version to 13.1.0 (#4787) 2022-01-20 13:01:24 -05:00
.github Run dependency check on prs and pushes that change dependencies (#4729) 2021-12-14 19:30:25 -07:00
.vscode Update vscode recommended extensions 2020-04-20 19:19:23 -04:00
automation Only test all-features if features exist (#4749) 2021-12-21 09:41:00 -07:00
build-scripts Use correct name for espresso-core dependency 2021-09-14 23:05:07 +02:00
components Adding shutdown support to sql-support 2022-02-02 10:01:30 -05:00
docs Upgrade rust to 1.57 (#4723) 2021-12-20 10:48:14 -07:00
examples Adding shutdown support to sql-support 2022-02-02 10:01:30 -05:00
gradle/wrapper Update android dependencies [ci full] (#4345) 2021-07-26 11:09:11 +10:00
libs style: fix Xcode capitalization (#4699) 2021-12-02 11:09:47 -08:00
megazords rust/xcframework changes to allow firefox-ios to build using spm (#4797) 2022-01-31 10:50:26 -10:00
taskcluster Updating libs/scripts to require Java 11 2021-09-14 13:08:29 -04:00
testing Places uniffication (#4770) 2022-01-20 15:00:00 -05:00
tools Places uniffication (#4770) 2022-01-20 15:00:00 -05:00
xcconfig style: fix Xcode capitalization (#4699) 2021-12-02 11:09:47 -08:00
.buildconfig-android.yml Cut release v91.0.0 (#4804) 2022-01-31 14:02:54 -08:00
.cron.yml Bug 1602861 - Add empty .cron.yml to allow the general cron task to run 2019-12-19 19:10:21 +01:00
.detekt.yml Update android dependencies [ci full] (#4345) 2021-07-26 11:09:11 +10:00
.gitignore Build iOS Rust code as an XCFramework. (#4396) 2021-08-20 12:44:56 -10:00
.gitmodules Remove submodule from .gitmodules 2021-03-22 18:14:41 -07:00
.mergify.yml Remove deprecated strict mode from Mergify (#4646) 2021-11-15 10:37:19 -08:00
.swiftlint.yml Add Nimbus to swiftlint.yml and fix lints 2021-04-16 07:53:55 -05:00
.taskcluster.yml Run taskgraph generation with Python 3 (#4394) 2021-08-23 08:25:28 -10:00
CHANGELOG.md Cut release v91.0.0 (#4804) 2022-01-31 14:02:54 -08:00
CHANGES_UNRELEASED.md Use BEGIN IMMEDIATE in `open_database` 2022-02-01 10:20:26 -05:00
CODE_OF_CONDUCT.md Bring CPG in line with CPGBot's demands, fixes #887 2019-03-31 15:38:31 -07:00
COPYRIGHT Remove the `ffi-support` crate sources from this repo. 2021-06-01 15:56:49 +10:00
Cargo.lock Adding shutdown support to sql-support 2022-02-02 10:01:30 -05:00
Cargo.toml Places uniffication (#4770) 2022-01-20 15:00:00 -05:00
Cartfile Update dependencies 2020-10-19 13:36:17 -04:00
Cartfile.resolved Added reporting of ios logins migration metrics (#4545) 2021-10-12 11:11:13 -04:00
DEPENDENCIES.md Run dependency check on prs and pushes that change dependencies (#4729) 2021-12-14 19:30:25 -07:00
LICENSE rc_crypto initial commit (#1349) 2019-07-09 14:00:48 -04:00
README.md README.md typo: Adding missing "a" (#4511) 2021-09-29 08:55:39 +10:00
build-carthage.sh Apply fixes for XCode 12 when running a local carthage build. 2020-12-22 16:50:33 +11:00
build.gradle Add mavenCentral repo to resolve protobuf dependencies 2022-01-12 20:31:18 -08:00
clippy.toml Document our use of clippy and add a (empty) clippy.toml 2019-03-20 09:02:54 -07:00
codecov.yml Tell codecov our default branch is `main` 2020-07-24 09:39:45 -07:00
gradle.properties Update Android dependencies 2020-04-08 13:23:31 -04:00
gradlew Import nimbus-sdk as submodule, republish as part of the megazord. 2020-11-09 16:40:21 +11:00
gradlew.bat Import nimbus-sdk as submodule, republish as part of the megazord. 2020-11-09 16:40:21 +11:00
proguard-rules-consumer-jna.pro Set consumer Proguard rules. 2018-11-27 20:29:10 -08:00
publish.gradle FML: Generate Kotlin from FML intermediate representation (#4607) r=tarik 2021-11-06 14:27:37 +00:00
rust-toolchain Upgrade rust to 1.57 (#4723) 2021-12-20 10:48:14 -07:00
settings.gradle Update Android dependencies 2020-04-08 13:23:31 -04:00

README.md

Firefox Application Services

Application Services (a-s) is a collection of Rust Components that are used to enable Firefox applications to integrate with Firefox accounts, sync, experimentation, etc. Each component is built using a core of shared code written in Rust, wrapped with native language bindings for different platforms.

Contributing

To contribute, please review the Mozilla Community Participation Guidelines and then visit our how to contribute guide.

Contact

Get in touch with other community members on Matrix, or through issues here on GitHub.

Documentation

High-level docs

The Application Services Book contains high-level documentation about the code in this repository. It's built from the ./docs/ directory.

Package docs

We use rustdoc to document both the public API of the components and the various internal implementation details. View them on https://mozilla.github.io/application-services/book/rust-docs/fxa_client/index.html. Once you have completed the build steps, you can view the docs by running:

cargo doc --no-deps --document-private-items --open

Building

Building the Rust Components

  1. Clone or Download the repository:
  $ git clone https://github.com/mozilla/application-services # (or use the ssh link)
  $ cd application-services
  $ git submodule init
  $ git submodule update --recursive
  1. Follow these instructions to install your system-level dependencies
  2. Run the a-s Rust unit tests
cargo test

Consumer build, integration and testing

The application-services library primary consumers are Fenix (Firefox on Android) and Firefox iOS. Assure you are able to run integration tests (for Android and iOS if using MacOS) by following the instructions to build for Android and iOS integrations.

Android integration builds and helpful tools

Firefox for iOS integration

Firefox Desktop

Rust Components

./components/ contains the source for each component, and its FFI bindings.

Please note that we are in the process of moving away from hand-written ffi code and instead favouring the use of the uniffi library.

List of components

  • autofill - for storage and syncing of credit card and address information
  • crashtest - testing-purposes (crashing the Rust code)
  • fxa-client - for applications that need to sign in with FxA, access encryption keys for sync, and more.
  • logins - for storage and syncing of a user's saved login credentials
  • nimbus - for integrating with Mozilla's experimentation platform for Firefox
  • places - for storage and syncing of a user's saved browsing history
  • push - for applications to receive real-time updates via WebPush
  • rc_log - for connecting component log output to the application's log stream
  • support - low-level utility libraries
  • sync15 - shared library for accessing data in Firefox Sync
  • sync_manager - integrates multiple sync engines/ stores into a single framework
  • tabs - an in-memory syncing engine for remote browser tabs
  • viaduct - an HTTP request library
  • webext-storage - powers an implementation of the chrome.storage.sync WebExtension API