* Update UniFFI dependency to v0.14.0

Co-authored-by: Ryan Kelly <ryan@rfk.id.au>
This commit is contained in:
Sammy Khamis 2021-08-19 16:31:02 -10:00 коммит произвёл GitHub
Родитель 32514b77ca
Коммит 6c839a3ade
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
41 изменённых файлов: 266 добавлений и 258 удалений

Просмотреть файл

@ -18,3 +18,15 @@ Use the template below to make assigning a version number during the release cut
- Description of the change with a link to the pull request ([#0000](https://github.com/mozilla/application-services/pull/0000))
-->
## Android
### ⚠️ Breaking Changes ⚠️
- Many error classes have been renamed from `FooError` or `FooErrorException` to just `FooException`,
to be more in keeping with Java/Kotlin idioms.
- This is due to UniFFi now replacing trailing 'Error' named classes to 'Exception'
## Autofill
### ⚠️ Breaking Changes ⚠️
- The `Error` enum is now called `AutofillError` (`AutofillException` in Kotlin) to avoid conflicts with builtin names.

205
Cargo.lock сгенерированный
Просмотреть файл

@ -59,9 +59,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.42"
version = "1.0.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486"
checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf"
[[package]]
name = "arrayref"
@ -218,9 +218,9 @@ dependencies = [
[[package]]
name = "bitflags"
version = "1.2.1"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitvec"
@ -292,18 +292,18 @@ checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040"
[[package]]
name = "camino"
version = "1.0.4"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4648c6d00a709aa069a236adcaae4f605a6241c72bf5bee79331a4b625921a9"
checksum = "52d74260d9bf6944e2208aa46841b4b8f0d7ffc0849a06837b2f510337f86b2b"
dependencies = [
"serde",
]
[[package]]
name = "cargo-platform"
version = "0.1.1"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0226944a63d1bf35a3b5f948dd7c59e263db83695c9e8bffc4037de02e30f1d7"
checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27"
dependencies = [
"serde",
]
@ -504,16 +504,16 @@ dependencies = [
[[package]]
name = "criterion"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab327ed7354547cc2ef43cbe20ef68b988e70b4b593cbd66a2a61733123a3d23"
checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10"
dependencies = [
"atty",
"cast",
"clap",
"criterion-plot",
"csv",
"itertools 0.10.1",
"itertools",
"lazy_static",
"num-traits",
"oorandom",
@ -530,12 +530,12 @@ dependencies = [
[[package]]
name = "criterion-plot"
version = "0.4.3"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e022feadec601fba1649cfa83586381a4ad31c6bf3a9ab7d408118b05dd9889d"
checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57"
dependencies = [
"cast",
"itertools 0.9.0",
"itertools",
]
[[package]]
@ -550,9 +550,9 @@ dependencies = [
[[package]]
name = "crossbeam-deque"
version = "0.8.0"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9"
checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
dependencies = [
"cfg-if 1.0.0",
"crossbeam-epoch",
@ -627,9 +627,9 @@ dependencies = [
[[package]]
name = "ctrlc"
version = "3.1.9"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "232295399409a8b7ae41276757b5a1cc21032848d42bff2352261f958b3ca29a"
checksum = "377c9b002a72a0b2c1a18c62e2f3864bdfea4a015e3683a96e24aa45dd6c02d1"
dependencies = [
"nix",
"winapi",
@ -926,9 +926,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
[[package]]
name = "ffi-support"
version = "0.4.3"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f476e3c4fa6d9a3e0eeabd4f7555a382025ec05194675d72fa1db347e53ae6c"
checksum = "27838c6815cfe9de2d3aeb145ffd19e565f577414b33f3bdbf42fe040e9e0ff6"
dependencies = [
"lazy_static",
"log",
@ -1302,9 +1302,9 @@ dependencies = [
[[package]]
name = "http-body"
version = "0.4.2"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9"
checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5"
dependencies = [
"bytes",
"http",
@ -1406,15 +1406,6 @@ version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9"
[[package]]
name = "itertools"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
dependencies = [
"either",
]
[[package]]
name = "itertools"
version = "0.10.1"
@ -1455,9 +1446,9 @@ dependencies = [
[[package]]
name = "js-sys"
version = "0.3.51"
version = "0.3.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062"
checksum = "ce791b7ca6638aae45be056e068fc756d871eb3b3b10b8efa62d1c9cec616752"
dependencies = [
"wasm-bindgen",
]
@ -1504,9 +1495,9 @@ dependencies = [
[[package]]
name = "libc"
version = "0.2.98"
version = "0.2.99"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765"
[[package]]
name = "libsqlite3-sys"
@ -1589,9 +1580,9 @@ dependencies = [
[[package]]
name = "matches"
version = "0.1.8"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]]
name = "megazord"
@ -1627,9 +1618,9 @@ dependencies = [
[[package]]
name = "memchr"
version = "2.4.0"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
[[package]]
name = "memoffset"
@ -1741,9 +1732,9 @@ checksum = "ba896fb4d7fe86433ebaf18c532bd9202e54c450a1bf7723855220e0e76d71d1"
[[package]]
name = "native-tls"
version = "0.2.7"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4"
checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d"
dependencies = [
"lazy_static",
"libc",
@ -1792,14 +1783,15 @@ dependencies = [
[[package]]
name = "nix"
version = "0.20.0"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a"
checksum = "cf1e25ee6b412c2a1e3fcb6a4499a5c1bfe7f43e014bdce9a6b6666e5aa2d187"
dependencies = [
"bitflags",
"cc",
"cfg-if 1.0.0",
"libc",
"memoffset",
]
[[package]]
@ -1951,9 +1943,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "openssl"
version = "0.10.35"
version = "0.10.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "549430950c79ae24e6d02e0b7404534ecf311d94cc9f861e9e4020187d13d885"
checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a"
dependencies = [
"bitflags",
"cfg-if 1.0.0",
@ -1980,9 +1972,9 @@ dependencies = [
[[package]]
name = "openssl-sys"
version = "0.9.65"
version = "0.9.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a7907e3bfa08bb85105209cdfcb6c63d109f8f6c1ed6ca318fff5c1853fbc1d"
checksum = "1996d2d305e561b70d1ee0c53f1542833f4e1ac6ce9a6708b6ff2738ca67dc82"
dependencies = [
"autocfg",
"cc",
@ -2293,7 +2285,7 @@ checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603"
dependencies = [
"bytes",
"heck",
"itertools 0.10.1",
"itertools",
"log",
"multimap",
"petgraph",
@ -2310,7 +2302,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba"
dependencies = [
"anyhow",
"itertools 0.10.1",
"itertools",
"proc-macro2",
"quote",
"syn",
@ -2586,9 +2578,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
[[package]]
name = "redox_syscall"
version = "0.2.9"
version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee"
checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
dependencies = [
"bitflags",
]
@ -2599,7 +2591,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8440d8acb4fd3d277125b4bd01a6f38aee8d814b3b5fc09b3f2b825d37d3fe8f"
dependencies = [
"redox_syscall 0.2.9",
"redox_syscall 0.2.10",
]
[[package]]
@ -2620,7 +2612,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
dependencies = [
"getrandom 0.2.3",
"redox_syscall 0.2.9",
"redox_syscall 0.2.10",
]
[[package]]
@ -2781,7 +2773,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
dependencies = [
"semver 1.0.3",
"semver 1.0.4",
]
[[package]]
@ -2859,9 +2851,9 @@ dependencies = [
[[package]]
name = "semver"
version = "1.0.3"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f3aac57ee7f3272d8395c6e4f502f434f0e289fcd62876f70daa008c20dcabe"
checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
[[package]]
name = "semver-parser"
@ -2880,18 +2872,18 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.126"
version = "1.0.127"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03"
checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_cbor"
version = "0.11.1"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622"
checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5"
dependencies = [
"half",
"serde",
@ -2899,9 +2891,9 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.126"
version = "1.0.127"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43"
checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc"
dependencies = [
"proc-macro2",
"quote",
@ -2910,9 +2902,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.64"
version = "1.0.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79"
checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127"
dependencies = [
"itoa",
"ryu",
@ -2921,9 +2913,9 @@ dependencies = [
[[package]]
name = "serde_test"
version = "1.0.126"
version = "1.0.127"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd1055d1c20532080b9da5040ec8e27425f4d4573d8e29eb19ba4ff1e4b9da2d"
checksum = "de9e52f2f83e2608a121618b6d3885b514613aac702306232c4f035ff60fdb56"
dependencies = [
"serde",
]
@ -2967,15 +2959,15 @@ dependencies = [
[[package]]
name = "slab"
version = "0.4.3"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527"
checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590"
[[package]]
name = "smallbitvec"
version = "2.5.0"
version = "2.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "797a4eaffb90d896f29698d45676f9f940a71936d7574996a7df54593ba209fa"
checksum = "75ce4f9dc4a41b4c3476cc925f1efb11b66df373a8fde5d4b8915fa91b5d995e"
[[package]]
name = "smallvec"
@ -2985,9 +2977,9 @@ checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
[[package]]
name = "socket2"
version = "0.4.0"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2"
checksum = "765f090f0e423d2b55843402a07915add955e7d60657db13707a159727326cad"
dependencies = [
"libc",
"winapi",
@ -3194,7 +3186,7 @@ dependencies = [
"cfg-if 1.0.0",
"libc",
"rand 0.8.4",
"redox_syscall 0.2.9",
"redox_syscall 0.2.10",
"remove_dir_all",
"winapi",
]
@ -3247,7 +3239,7 @@ checksum = "077185e2eac69c3f8379a4298e1e07cd36beb962290d4a51199acf0fdc10607e"
dependencies = [
"libc",
"numtoa",
"redox_syscall 0.2.9",
"redox_syscall 0.2.10",
"redox_termios",
]
@ -3326,9 +3318,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
version = "1.9.0"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b7b349f11a7047e6d1276853e612d152f5e8a352c61917887cc2169e2366b4c"
checksum = "01cf844b23c6131f624accf65ce0e4e9956a8bb329400ea5bcc26ae3a5c20b0b"
dependencies = [
"autocfg",
"bytes",
@ -3392,9 +3384,9 @@ dependencies = [
[[package]]
name = "tracing-core"
version = "0.1.18"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052"
checksum = "2ca517f43f0fb96e0c3072ed5c275fe5eece87e8cb52f4a77b69226d3b1c9df8"
dependencies = [
"lazy_static",
]
@ -3429,12 +3421,9 @@ checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]]
name = "unicode-bidi"
version = "0.3.5"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0"
dependencies = [
"matches",
]
checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085"
[[package]]
name = "unicode-normalization"
@ -3465,14 +3454,13 @@ checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]]
name = "uniffi"
version = "0.12.0"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e2749a4075e662e6ac28bed98b579f6d66bfabcfbe3fea5de6709334aaf8343"
checksum = "bcea4351e564535b4b4f87832e0643102811bda015f7b22bf7ca9a80aa8d0713"
dependencies = [
"anyhow",
"bytes",
"cargo_metadata",
"ffi-support",
"lazy_static",
"log",
"paste 1.0.5",
@ -3481,9 +3469,9 @@ dependencies = [
[[package]]
name = "uniffi_bindgen"
version = "0.12.0"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59fbb8000ed428fc9da5066af68bc2c04084a2233fb67bf5d0f5727b05c236b6"
checksum = "099233af0d9f7cd36a719c2ac089639618343cb5fce9a5a1e04de46846ff8813"
dependencies = [
"anyhow",
"askama",
@ -3497,9 +3485,9 @@ dependencies = [
[[package]]
name = "uniffi_build"
version = "0.12.0"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4a45dcfc8bad77ee7b13380f8c1e57648e126b9a5f8ff101172d543d94ec53a"
checksum = "7bbdf8d6cf502565f75cc395a34840dc128ffed5086af73abcf235e1f91175bc"
dependencies = [
"anyhow",
"uniffi_bindgen",
@ -3507,9 +3495,9 @@ dependencies = [
[[package]]
name = "uniffi_macros"
version = "0.12.0"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16d30c114f99379b3ac762e2220c76c21582af80fd105a1d1ad194c89e17c12d"
checksum = "7002a69172990e44447537c396832b1ea83676d39df7f1c09654e126c08fd68a"
dependencies = [
"glob",
"proc-macro2",
@ -3619,9 +3607,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
[[package]]
name = "wasm-bindgen"
version = "0.2.74"
version = "0.2.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd"
checksum = "b608ecc8f4198fe8680e2ed18eccab5f0cd4caaf3d83516fa5fb2e927fda2586"
dependencies = [
"cfg-if 1.0.0",
"serde",
@ -3631,9 +3619,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.74"
version = "0.2.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900"
checksum = "580aa3a91a63d23aac5b6b267e2d13cb4f363e31dce6c352fca4752ae12e479f"
dependencies = [
"bumpalo",
"lazy_static",
@ -3646,9 +3634,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.24"
version = "0.4.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1"
checksum = "16646b21c3add8e13fdb8f20172f8a28c3dbf62f45406bcff0233188226cfe0c"
dependencies = [
"cfg-if 1.0.0",
"js-sys",
@ -3658,9 +3646,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.74"
version = "0.2.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4"
checksum = "171ebf0ed9e1458810dfcb31f2e766ad6b3a89dbda42d8901f2b268277e5f09c"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@ -3668,9 +3656,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.74"
version = "0.2.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97"
checksum = "6c2657dd393f03aa2a659c25c6ae18a13a4048cebd220e147933ea837efc589f"
dependencies = [
"proc-macro2",
"quote",
@ -3681,15 +3669,15 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.74"
version = "0.2.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f"
checksum = "2e0c4a743a309662d45f4ede961d7afa4ba4131a59a639f29b0069c3798bbcc2"
[[package]]
name = "web-sys"
version = "0.3.51"
version = "0.3.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582"
checksum = "01c70a82d842c9979078c772d4a1344685045f1a5628f677c2b2eab4dd7d2696"
dependencies = [
"js-sys",
"wasm-bindgen",
@ -3753,11 +3741,12 @@ dependencies = [
[[package]]
name = "which"
version = "4.1.0"
version = "4.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe"
checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9"
dependencies = [
"either",
"lazy_static",
"libc",
]

Просмотреть файл

@ -117,3 +117,13 @@ lto = "thin"
# We always want to use the local version of our own crates in that case.
[patch."https://github.com/mozilla/application-services"]
viaduct = { path = "components/viaduct" }
# If you need to test some local changes to UniFFI, uncomment these lines
# for a convenient way to use a local checkout rather than the published version.
# You just have to make sure that the version number in your local checkout
# matches the one used in the `Cargo.toml` files in this workspace.
#[patch.crates-io]
#uniffi = { path = "../uniffi-rs/uniffi" }
#uniffi_bindgen = { path = "../uniffi-rs/uniffi_bindgen" }
#uniffi_build = { path = "../uniffi-rs/uniffi_build" }
#uniffi_macros = { path = "../uniffi-rs/uniffi_macros" }

Просмотреть файл

@ -476,7 +476,7 @@ The following text applies to code linked from these dependencies:
[env_logger](https://github.com/sebasmagri/env_logger/),
[fallible-iterator](https://github.com/sfackler/rust-fallible-iterator),
[fallible-streaming-iterator](https://github.com/sfackler/fallible-streaming-iterator),
[ffi-support](https://github.com/mozilla/application-services),
[ffi-support](https://github.com/mozilla/ffi-support),
[flate2](https://github.com/rust-lang/flate2-rs),
[fnv](https://github.com/servo/rust-fnv),
[foreign-types-shared](https://github.com/sfackler/foreign-types),
@ -824,7 +824,7 @@ SOFTWARE.
The following text applies to code linked from these dependencies:
[aho-corasick](https://github.com/BurntSushi/aho-corasick),
[byteorder](https://github.com/BurntSushi/byteorder),
[memchr](https://github.com/BurntSushi/rust-memchr),
[memchr](https://github.com/BurntSushi/memchr),
[termcolor](https://github.com/BurntSushi/termcolor)
```

Просмотреть файл

@ -66,7 +66,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation "junit:junit:$junit_version"
testImplementation "org.robolectric:robolectric:$roboelectric_core_version"
testImplementation "org.robolectric:robolectric:$robolectric_core_version"
testImplementation "org.mockito:mockito-core:$mockito_core_version"
androidTestImplementation "androidx.test:runner:$androidx_test_runner_version"

Просмотреть файл

@ -19,7 +19,7 @@ buildscript {
junit_version = '4.13'
maven_publish_version = '3.6.2'
mockito_core_version = '2.24.5'
roboelectric_core_version = '4.3.1'
robolectric_core_version = '4.5.1'
rust_android_gradle_version = '0.8.3'
espresso_core_version = '3.3.0'
protobuf_version = '3.11.4'

Просмотреть файл

@ -23,7 +23,7 @@ sync15 = { path = "../sync15" }
sync15-traits = {path = "../support/sync15-traits"}
thiserror = "1.0"
types = { path = "../support/types" }
uniffi = "^0.12"
uniffi = "^0.14"
url = { version = "2.1", features = ["serde"] }
[dependencies.rusqlite]
@ -36,4 +36,4 @@ libsqlite3-sys = "0.20.1"
[build-dependencies]
nss_build_common = { path = "../support/rc_crypto/nss/nss_build_common" }
uniffi_build = { version = "^0.12", features = [ "builtin-bindgen" ]}
uniffi_build = { version = "^0.14", features = [ "builtin-bindgen" ]}

Просмотреть файл

@ -2,16 +2,16 @@ namespace autofill {
// We expose the crypto primitives on the namespace
// Create a new, random, encryption key.
[Throws=Error]
[Throws=AutofillError]
string create_key();
// Encrypt an arbitrary string - `key` must have come from `create_key()`
[Throws=Error]
[Throws=AutofillError]
string encrypt_string(string key, string cleartext);
// Decrypt an arbitrary string - `key` must have come from `create_key()`
// and `ciphertext` must have come from `encrypt_string()`
[Throws=Error]
[Throws=AutofillError]
string decrypt_string(string key, string ciphertext);
};
@ -80,53 +80,53 @@ dictionary Address {
};
[Error]
enum Error {
enum AutofillError {
"OpenDatabaseError", "SqlError", "IoError", "InterruptedError",
"IllegalDatabasePath", "Utf8Error", "JsonError", "InvalidSyncPayload",
"MissingEncryptionKey", "CryptoError", "NoSuchRecord",
};
interface Store {
[Throws=Error]
[Throws=AutofillError]
constructor(string dbpath);
[Throws=Error]
[Throws=AutofillError]
CreditCard add_credit_card(UpdatableCreditCardFields cc);
[Throws=Error]
[Throws=AutofillError]
CreditCard get_credit_card(string guid);
[Throws=Error]
[Throws=AutofillError]
sequence<CreditCard> get_all_credit_cards();
[Throws=Error]
[Throws=AutofillError]
void update_credit_card(string guid, UpdatableCreditCardFields cc);
[Throws=Error]
[Throws=AutofillError]
boolean delete_credit_card(string guid);
[Throws=Error]
[Throws=AutofillError]
void touch_credit_card(string guid);
[Throws=Error]
[Throws=AutofillError]
Address add_address(UpdatableAddressFields a);
[Throws=Error]
[Throws=AutofillError]
Address get_address(string guid);
[Throws=Error]
[Throws=AutofillError]
sequence<Address> get_all_addresses();
[Throws=Error]
[Throws=AutofillError]
void update_address(string guid, UpdatableAddressFields a);
[Throws=Error]
[Throws=AutofillError]
boolean delete_address(string guid);
[Throws=Error]
[Throws=AutofillError]
void touch_address(string guid);
[Throws=Error, Self=ByArc]
[Throws=AutofillError, Self=ByArc]
void scrub_encrypted_data();
[Self=ByArc]

Просмотреть файл

@ -19,6 +19,6 @@ use crate::db::models::address::*;
use crate::db::models::credit_card::*;
use crate::db::store::Store;
use crate::encryption::{create_key, decrypt_string, encrypt_string};
use error::Error;
use error::Error as AutofillError;
include!(concat!(env!("OUT_DIR"), "/autofill.uniffi.rs"));

Просмотреть файл

@ -1,3 +1,6 @@
[bindings.kotlin]
package_name = "mozilla.appservices.autofill"
cdylib_name = "megazord"
[bindings.swift]
generate_module_map = false

Просмотреть файл

@ -9,8 +9,8 @@ exclude = ["/android", "/ios"]
[dependencies]
log = "0.4"
thiserror = "1.0"
uniffi = "^0.12"
uniffi_macros = "^0.12"
uniffi = "^0.14"
uniffi_macros = "^0.14"
[build-dependencies]
uniffi_build = { version = "^0.12", features=["builtin-bindgen"] }
uniffi_build = { version = "^0.14", features=["builtin-bindgen"] }

Просмотреть файл

@ -25,7 +25,7 @@ class CrashTestHelpersTest {
fun testErrorsAreThrown() {
try {
triggerRustError()
} catch (e: CrashTestErrorException) {
} catch (e: CrashTestException) {
assertEquals(e.message, "Error! From The Rust Code.")
}
}

Просмотреть файл

@ -8,6 +8,10 @@
//! crash the application. It's intended to help developers test the crash-handling
//! and crash-reporting capabilities of their app.
// Temporary, to work around a clippy lint in generated code.
// https://github.com/mozilla/uniffi-rs/issues/1018
#![allow(clippy::redundant_closure)]
use thiserror::Error;
#[cfg(test)]

Просмотреть файл

@ -1,3 +1,7 @@
[bindings.kotlin]
package_name = "mozilla.appservices.crashtest"
cdylib_name = "megazord"
[bindings.swift]
generate_module_map = false

Просмотреть файл

@ -26,11 +26,11 @@ error-support = { path = "../support/error" }
thiserror = "1.0"
anyhow = "1.0"
sync-guid = { path = "../support/guid", features = ["random"] }
uniffi = "^0.12"
uniffi_macros = "^0.12"
uniffi = "^0.14"
uniffi_macros = "^0.14"
[build-dependencies]
uniffi_build = { version = "^0.12", features=["builtin-bindgen"] }
uniffi_build = { version = "^0.14", features=["builtin-bindgen"] }
[dev-dependencies]
viaduct-reqwest = { path = "../support/viaduct-reqwest" }

Просмотреть файл

@ -86,7 +86,7 @@ class PersistedFirefoxAccount(inner: FirefoxAccount, persistCallback: PersistCal
val json: String
try {
json = this.toJSONString()
} catch (e: FxaErrorException) {
} catch (e: FxaException) {
Log.e("FirefoxAccount", "Error serializing the FirefoxAccount state.")
return
}

Просмотреть файл

@ -1,3 +1,6 @@
[bindings.kotlin]
package_name = "mozilla.appservices.fxaclient"
cdylib_name = "megazord"
[bindings.swift]
generate_module_map = false

Просмотреть файл

@ -25,15 +25,15 @@ error-support = { path = "../support/error" }
sync-guid = { path = "../support/guid", features = ["rusqlite_support", "random"] }
thiserror = "1.0"
anyhow = "1.0"
uniffi = "^0.12"
uniffi_macros = "^0.12"
uniffi = "^0.14"
uniffi_macros = "^0.14"
[dependencies.rusqlite]
version = "0.24.2"
features = ["sqlcipher", "limits", "unlock_notify"]
[build-dependencies]
uniffi_build = { version = "^0.12.0", features=["builtin-bindgen"] }
uniffi_build = { version = "^0.14.0", features=["builtin-bindgen"] }
[dev-dependencies]
more-asserts = "0.2"

Просмотреть файл

@ -18,9 +18,6 @@ import org.mozilla.appservices.logins.GleanMetrics.LoginsStore as LoginsStoreMet
import mozilla.components.service.glean.private.CounterMetricType
import mozilla.components.service.glean.private.LabeledMetricType
// uniffi has unfortunate names for errors: https://github.com/mozilla/uniffi-rs/issues/442
typealias LoginsStorageException = LoginsStorageErrorException
/**
* An artifact of the uniffi conversion - a thin-ish wrapper around a
LoginStore.
@ -33,7 +30,7 @@ class DatabaseLoginsStorage(private val dbPath: String) : AutoCloseable {
}
private fun checkUnlocked(): LoginStore {
val store = this.store.get() ?: throw LoginsStorageException("Using DatabaseLoginsStorage without unlocking first")
val store = this.store.get() ?: throw LoginsStorageException.UnexpectedLoginsStorageException("Using DatabaseLoginsStorage without unlocking first")
return store
}
@ -42,7 +39,7 @@ class DatabaseLoginsStorage(private val dbPath: String) : AutoCloseable {
fun lock() {
val store = this.store.getAndSet(null)
if (store == null) {
throw LoginsStorageErrorException.MismatchedLock("Lock called when we are already locked")
throw LoginsStorageException.MismatchedLock("Lock called when we are already locked")
}
store.destroy()
}
@ -54,7 +51,7 @@ class DatabaseLoginsStorage(private val dbPath: String) : AutoCloseable {
val store = LoginStore(dbPath, encryptionKey)
if (this.store.getAndSet(store) != null) {
// this seems wrong?
throw LoginsStorageErrorException.MismatchedLock("Unlock called when we are already unlocked")
throw LoginsStorageException.MismatchedLock("Unlock called when we are already unlocked")
}
}
}
@ -153,9 +150,9 @@ class DatabaseLoginsStorage(private val dbPath: String) : AutoCloseable {
}
}
@Throws(LoginsStorageErrorException.InvalidRecord::class)
@Throws(LoginsStorageException.InvalidRecord::class)
fun ensureValid(login: Login) {
readQueryCounters.measureIgnoring({ e -> e is LoginsStorageErrorException.InvalidRecord }) {
readQueryCounters.measureIgnoring({ e -> e is LoginsStorageException.InvalidRecord }) {
checkUnlocked().checkValidWithNoDupes(login)
}
}
@ -227,22 +224,22 @@ class LoginsStoreCounterMetrics(
throw e
}
when (e) {
is LoginsStorageErrorException.MismatchedLock -> {
is LoginsStorageException.MismatchedLock -> {
errCount["mismatched_lock"].add()
}
is LoginsStorageErrorException.NoSuchRecord -> {
is LoginsStorageException.NoSuchRecord -> {
errCount["no_such_record"].add()
}
is LoginsStorageErrorException.IdCollision -> {
is LoginsStorageException.IdCollision -> {
errCount["id_collision"].add()
}
is LoginsStorageErrorException.InvalidKey -> {
is LoginsStorageException.InvalidKey -> {
errCount["invalid_key"].add()
}
is LoginsStorageErrorException.Interrupted -> {
is LoginsStorageException.Interrupted -> {
errCount["interrupted"].add()
}
is LoginsStorageErrorException.InvalidRecord -> {
is LoginsStorageException.InvalidRecord -> {
errCount["invalid_record"].add()
}
is LoginsStorageException -> {

Просмотреть файл

@ -103,7 +103,7 @@ class DatabaseLoginsStorageTest {
try {
store.unlock("wrongkey")
fail("Should have thrown")
} catch (e: LoginsStorageErrorException.InvalidKey) {
} catch (e: LoginsStorageException.InvalidKey) {
// All good.
}
store.unlock(key)
@ -115,7 +115,7 @@ class DatabaseLoginsStorageTest {
try {
store.unlock(key)
fail("Should have thrown")
} catch (e: LoginsStorageErrorException.MismatchedLock) {
} catch (e: LoginsStorageException.MismatchedLock) {
// All good.
}
assertEquals(LoginsStoreMetrics.unlockCount.testGetValue(), 4)
@ -162,7 +162,7 @@ class DatabaseLoginsStorageTest {
try {
store.add(invalid)
fail("Should have thrown")
} catch (e: LoginsStorageErrorException.InvalidRecord) {
} catch (e: LoginsStorageException.InvalidRecord) {
// All good.
}
@ -182,7 +182,7 @@ class DatabaseLoginsStorageTest {
try {
store.ensureValid(invalid)
fail("Should have thrown")
} catch (e: LoginsStorageErrorException.InvalidRecord) {
} catch (e: LoginsStorageException.InvalidRecord) {
// All good.
}
@ -197,12 +197,12 @@ class DatabaseLoginsStorageTest {
val test = getTestStore()
assertEquals(test.isLocked(), true)
assertThrows(LoginsStorageErrorException::class.java) { test.get("aaaaaaaaaaaa") }
assertThrows(LoginsStorageErrorException::class.java) { test.list() }
assertThrows(LoginsStorageErrorException::class.java) { test.delete("aaaaaaaaaaaa") }
assertThrows(LoginsStorageErrorException::class.java) { test.touch("bbbbbbbbbbbb") }
assertThrows(LoginsStorageErrorException::class.java) { test.wipe() }
assertThrows(LoginsStorageErrorException::class.java) {
assertThrows(LoginsStorageException::class.java) { test.get("aaaaaaaaaaaa") }
assertThrows(LoginsStorageException::class.java) { test.list() }
assertThrows(LoginsStorageException::class.java) { test.delete("aaaaaaaaaaaa") }
assertThrows(LoginsStorageException::class.java) { test.touch("bbbbbbbbbbbb") }
assertThrows(LoginsStorageException::class.java) { test.wipe() }
assertThrows(LoginsStorageException::class.java) {
@Suppress("DEPRECATION")
test.reset()
}
@ -251,7 +251,7 @@ class DatabaseLoginsStorageTest {
assertEquals(b.timesUsed + 1, newB!!.timesUsed)
assert(newB.timeLastUsed > b.timeLastUsed)
assertThrows(LoginsStorageErrorException.NoSuchRecord::class.java) { test.touch("abcdabcdabcd") }
assertThrows(LoginsStorageException.NoSuchRecord::class.java) { test.touch("abcdabcdabcd") }
finishAndClose(test)
}
@ -306,7 +306,7 @@ class DatabaseLoginsStorageTest {
val test = getTestStore()
test.unlock(encryptionKey)
assertThrows(LoginsStorageErrorException.IdCollision::class.java) {
assertThrows(LoginsStorageException.IdCollision::class.java) {
test.add(Login(
id = "aaaaaaaaaaaa",
hostname = "https://www.foo.org",
@ -324,7 +324,7 @@ class DatabaseLoginsStorageTest {
}
for (record in INVALID_RECORDS) {
assertThrows(LoginsStorageErrorException.InvalidRecord::class.java) {
assertThrows(LoginsStorageException.InvalidRecord::class.java) {
test.add(record)
}
}
@ -431,11 +431,11 @@ class DatabaseLoginsStorageTest {
timePasswordChanged = 0
)
assertThrows(LoginsStorageErrorException.InvalidRecord::class.java) {
assertThrows(LoginsStorageException.InvalidRecord::class.java) {
test.ensureValid(dupeLogin)
}
assertThrows(LoginsStorageErrorException.InvalidRecord::class.java) {
assertThrows(LoginsStorageException.InvalidRecord::class.java) {
test.ensureValid(nullValueLogin)
}
@ -491,7 +491,7 @@ class DatabaseLoginsStorageTest {
val test = getTestStore()
test.unlock(encryptionKey)
assertThrows(LoginsStorageErrorException.NoSuchRecord::class.java) {
assertThrows(LoginsStorageException.NoSuchRecord::class.java) {
test.update(Login(
id = "123412341234",
hostname = "https://www.foo.org",
@ -510,7 +510,7 @@ class DatabaseLoginsStorageTest {
for (record in INVALID_RECORDS) {
val updateArg = record.copy(id = "aaaaaaaaaaaa")
assertThrows(LoginsStorageErrorException.InvalidRecord::class.java) {
assertThrows(LoginsStorageException.InvalidRecord::class.java) {
test.update(updateArg)
}
}
@ -566,7 +566,7 @@ class DatabaseLoginsStorageTest {
fun testUnlockAfterError() {
val test = getTestStore()
assertThrows(LoginsStorageErrorException::class.java) {
assertThrows(LoginsStorageException::class.java) {
test.reset()
}

Просмотреть файл

@ -1,3 +1,6 @@
[bindings.kotlin]
package_name = "mozilla.appservices.logins"
cdylib_name = "megazord"
[bindings.swift]
generate_module_map = false

Просмотреть файл

@ -33,10 +33,10 @@ uuid = { version = "0.8", features = ["serde", "v4"]}
sha2 = "0.9"
hex = "0.4"
once_cell = "1"
uniffi = { version = "^0.12", optional = true }
uniffi = { version = "^0.14", optional = true }
[build-dependencies]
uniffi_build = { version = "^0.12", features = [ "builtin-bindgen" ], optional = true }
uniffi_build = { version = "^0.14", features = [ "builtin-bindgen" ], optional = true }
[dev-dependencies]
viaduct-reqwest = { path = "../support/viaduct-reqwest" }

Просмотреть файл

@ -28,7 +28,7 @@ import org.mozilla.experiments.nimbus.internal.EnrolledExperiment
import org.mozilla.experiments.nimbus.internal.EnrollmentChangeEvent
import org.mozilla.experiments.nimbus.internal.EnrollmentChangeEventType
import org.mozilla.experiments.nimbus.internal.ExperimentBranch
import org.mozilla.experiments.nimbus.internal.NimbusErrorException
import org.mozilla.experiments.nimbus.internal.NimbusException
import org.mozilla.experiments.nimbus.internal.NimbusClient
import org.mozilla.experiments.nimbus.internal.NimbusClientInterface
import org.mozilla.experiments.nimbus.internal.RemoteSettingsConfig
@ -426,9 +426,9 @@ open class Nimbus(
try {
nimbusClient.fetchExperiments()
observer?.onExperimentsFetched()
} catch (e: NimbusErrorException.RequestError) {
} catch (e: NimbusException.RequestException) {
errorReporter("Error fetching experiments from endpoint", e)
} catch (e: NimbusErrorException.ResponseError) {
} catch (e: NimbusException.ResponseException) {
errorReporter("Error fetching experiments from endpoint", e)
}
}
@ -446,7 +446,7 @@ open class Nimbus(
nimbusClient.applyPendingExperiments().also(::recordExperimentTelemetryEvents)
// Get the experiments to record in telemetry
postEnrolmentCalculation()
} catch (e: NimbusErrorException.InvalidExperimentFormat) {
} catch (e: NimbusException.InvalidExperimentFormat) {
errorReporter("Invalid experiment format", e)
}
}

Просмотреть файл

@ -1,3 +1,6 @@
[bindings.kotlin]
package_name = "org.mozilla.experiments.nimbus.internal"
cdylib = "megazord"
[bindings.swift]
generate_module_map = false

Просмотреть файл

@ -34,8 +34,8 @@ error-support = { path = "../support/error" }
sync-guid = { path = "../support/guid", features = ["rusqlite_support", "random"]}
thiserror = "1.0"
anyhow = "1.0"
uniffi = "^0.12"
uniffi_macros = "^0.12"
uniffi = "^0.14"
uniffi_macros = "^0.14"
[dependencies.rusqlite]
version = "0.24.2"
@ -47,4 +47,4 @@ tempfile = "3.1"
env_logger = {version = "0.7", default-features = false}
[build-dependencies]
uniffi_build = { version = "^0.12", features=["builtin-bindgen"] }
uniffi_build = { version = "^0.14", features=["builtin-bindgen"] }

Просмотреть файл

@ -8,7 +8,7 @@ import com.sun.jna.Native
import com.sun.jna.Pointer
import com.sun.jna.StringArray
import mozilla.appservices.places.uniffi.DocumentType
import mozilla.appservices.places.uniffi.ErrorWrapperException
import mozilla.appservices.places.uniffi.ErrorWrapper
import mozilla.appservices.places.uniffi.HistoryMetadata
import mozilla.appservices.places.uniffi.HistoryMetadataObservation
import mozilla.appservices.support.native.toNioDirectBuffer
@ -187,7 +187,7 @@ internal inline fun <U> rustCallUniffi(syncOn: Any, callback: () -> U): U {
synchronized(syncOn) {
try {
return callback()
} catch (e: ErrorWrapperException.Wrapped) {
} catch (e: ErrorWrapper.Wrapped) {
// uniffi-generated functions currently return just a single error
// type, which inside its message is the underlying error code
// and message, which we can use to construct the actual error

Просмотреть файл

@ -24,8 +24,8 @@ interrupt-support = { path = "../../support/interrupt" }
sql-support = { path = "../../support/sql" }
sync-guid = { path = "../../support/guid" }
types = { path = "../../support/types" }
uniffi = "^0.12"
uniffi_macros = "^0.12"
uniffi = "^0.14"
uniffi_macros = "^0.14"
[dependencies.sync15]
path = "../../sync15"

Просмотреть файл

@ -177,7 +177,7 @@ public enum PlacesError: LocalizedError {
// If we couldn't get the right code, default to unexpected error
let code = Int32(splitError[0]) ?? 1
let message = splitError[1]
throw makeException(code: PlacesErrorCode(rawValue: code), message: message)!
throw makeException(code: PlacesErrorCode(code), message: message)!
default:
throw PlacesError.unexpected(message: "Unexpected Error")
}

Просмотреть файл

@ -239,7 +239,7 @@ fn get_error_number(err: &Error) -> i32 {
/// unpacks this and returns the exact same error objects as if it was an
/// `ExternError` in the first place.
#[derive(Debug)]
enum ErrorWrapper {
pub enum ErrorWrapper {
Wrapped(String),
}
@ -280,34 +280,8 @@ implement_into_ffi_by_delegation!(
msg_types::BookmarkNode
);
/// Implements [`IntoFfi`] for the provided types (more than one may be passed in) implementing
/// `uniffi::ViaFfi` (UniFFI auto-generated serialization) by delegating to that implementation.
///
/// This is only necessary because we have a kinda "hybrid" FFI situation -
/// some things generated via UniFFI, others by hand. Because this macro only
/// makes sense in this Frankenstein world it's not in UniFFI itself.
#[macro_export]
macro_rules! implement_into_ffi_by_uniffi {
($($FFIType:ty),* $(,)*) => {$(
unsafe impl ffi_support::IntoFfi for $FFIType where $FFIType: uniffi::ViaFfi {
type Value = <Self as uniffi::ViaFfi>::FfiType;
#[inline]
fn ffi_default() -> Self::Value {
Default::default()
}
#[inline]
fn into_ffi_value(self) -> Self::Value {
<Self as uniffi::ViaFfi>::lower(self)
}
}
)*}
}
implement_into_ffi_by_uniffi!(crate::storage::history_metadata::HistoryMetadata);
uniffi_macros::include_scaffolding!("places");
// Exists just to convince uniffi to generate `liftSequence*` helpers!
struct Dummy {
pub struct Dummy {
md: Option<Vec<HistoryMetadata>>,
}

Просмотреть файл

@ -61,5 +61,5 @@ dictionary Dummy {
[Error]
enum ErrorWrapper {
"Wrapped",
"Wrapped"
};

Просмотреть файл

@ -3,3 +3,6 @@
# kotlin errors about being unable to resolve which `rustCall` to use.
package_name = "mozilla.appservices.places.uniffi"
cdylib_name = "megazord"
[bindings.swift]
generate_module_map = false

Просмотреть файл

@ -23,8 +23,8 @@ interrupt-support = { path = "../support/interrupt" }
sync-guid = { path = "../support/guid", features = ["random"] }
thiserror = "1.0"
anyhow = "1.0"
uniffi = "^0.12.0"
uniffi_macros = "^0.12"
uniffi = "^0.14.0"
uniffi_macros = "^0.14"
[build-dependencies]
uniffi_build = { version = "^0.12.0", features = [ "builtin-bindgen" ]}
uniffi_build = { version = "^0.14.0", features = [ "builtin-bindgen" ]}

Просмотреть файл

@ -1,3 +1,6 @@
[bindings.kotlin]
package_name = "mozilla.appservices.remotetabs"
cdylib_name = "megazord"
[bindings.swift]
generate_module_map = false

Просмотреть файл

@ -134,7 +134,7 @@ Edit `megazords/ios/MozillaAppServices.h` and add an import line for your compon
like:
```
#import "uniffi_<your_crate_name>_Bridging-Header.h"
#import "<your_crate_name>FFI.h"
```
You will then need to add your component into the iOS ["megazord"](../design/megazords.md)
@ -150,7 +150,7 @@ the `./ios/` directory you created above. Add the following entries to the Group
* A sub-group named "Generated", pointing to the `./Generated/` subdirectory, and
containing entries for the files generated by UniFFI:
* `<your_crate_name>.swift`
* `uniffi_<your_crate_name>-Bridging-Header.h`
* `<your_crate_name>FFI.h`
The result should look something like this:
@ -166,7 +166,7 @@ The result should look something like this:
![Screenshot of XCode Compile Sources list](./img/xcode_add_component_2.png)
In the same "Build Phases" screen, under the "Headers" section, add `uniffi_<your_crate_name>-Bridging-Header.h` to the list of Public headers.
In the same "Build Phases" screen, under the "Headers" section, add `<your_crate_name>FFI.h` to the list of Public headers.
The result should look something like this:
![Screenshot of XCode Headers list](./img/xcode_add_component_3.png)

Просмотреть файл

@ -267,7 +267,7 @@ It's easiest to start by removing all of the hand-written Swift code under `./io
restoring parts of it later if necessary.
Edit `/megazords/ios/MozillaAppServices.h` to remove any references to `Rust<ComponentName>API.h`,
replacing them with the UniFFI-generated header file name `uniffi_<component_name>-Bridging-Header.h`.
replacing them with the UniFFI-generated header file name `<component_name>FFI.h`.
Open `/megazords/ios/MozillaAppServices.xcodeproj` in XCode and follow the instructions for
[adding Swift bindings for a new component](adding-a-new-component.md#the-swift-bindings) to

Просмотреть файл

@ -446,7 +446,7 @@ The following text applies to code linked from these dependencies:
[either](https://github.com/bluss/either),
[fallible-iterator](https://github.com/sfackler/rust-fallible-iterator),
[fallible-streaming-iterator](https://github.com/sfackler/fallible-streaming-iterator),
[ffi-support](https://github.com/mozilla/application-services),
[ffi-support](https://github.com/mozilla/ffi-support),
[form_urlencoded](https://github.com/servo/rust-url),
[getrandom](https://github.com/rust-random/getrandom),
[glob](https://github.com/rust-lang/glob),
@ -727,7 +727,7 @@ limitations under the License.
The following text applies to code linked from these dependencies:
[aho-corasick](https://github.com/BurntSushi/aho-corasick),
[byteorder](https://github.com/BurntSushi/byteorder),
[memchr](https://github.com/BurntSushi/rust-memchr)
[memchr](https://github.com/BurntSushi/memchr)
```
The MIT License (MIT)

Просмотреть файл

@ -446,7 +446,7 @@ the details of which are reproduced below.
</license>
<license>
<name>MIT License: memchr</name>
<url>https://github.com/BurntSushi/rust-memchr/blob/master/LICENSE-MIT</url>
<url>https://github.com/BurntSushi/memchr/blob/master/LICENSE-MIT</url>
</license>
<license>
<name>MIT License: bincode</name>

Просмотреть файл

@ -468,7 +468,7 @@ The following text applies to code linked from these dependencies:
[env_logger](https://github.com/sebasmagri/env_logger/),
[fallible-iterator](https://github.com/sfackler/rust-fallible-iterator),
[fallible-streaming-iterator](https://github.com/sfackler/fallible-streaming-iterator),
[ffi-support](https://github.com/mozilla/application-services),
[ffi-support](https://github.com/mozilla/ffi-support),
[flate2](https://github.com/rust-lang/flate2-rs),
[fnv](https://github.com/servo/rust-fnv),
[form_urlencoded](https://github.com/servo/rust-url),
@ -806,7 +806,7 @@ SOFTWARE.
The following text applies to code linked from these dependencies:
[aho-corasick](https://github.com/BurntSushi/aho-corasick),
[byteorder](https://github.com/BurntSushi/byteorder),
[memchr](https://github.com/BurntSushi/rust-memchr),
[memchr](https://github.com/BurntSushi/memchr),
[termcolor](https://github.com/BurntSushi/termcolor)
```

Просмотреть файл

@ -7,11 +7,11 @@
FOUNDATION_EXPORT double MegazordClientVersionNumber;
FOUNDATION_EXPORT const unsigned char MegazordClientVersionString[];
#import "uniffi_crashtest-Bridging-Header.h"
#import "uniffi_fxa_client-Bridging-Header.h"
#import "uniffi_nimbus-Bridging-Header.h"
#import "uniffi_logins-Bridging-Header.h"
#import "uniffi_places-Bridging-Header.h"
#import "crashtestFFI.h"
#import "fxa_clientFFI.h"
#import "nimbusFFI.h"
#import "loginsFFI.h"
#import "placesFFI.h"
#import "RustLogFFI.h"
#import "RustPlacesAPI.h"
#import "RustViaductFFI.h"

Просмотреть файл

@ -8,11 +8,11 @@
/* Begin PBXBuildFile section */
1B9B8F00267439F800C8A918 /* places.udl in Sources */ = {isa = PBXBuildFile; fileRef = 1B9B8EFE267439CC00C8A918 /* places.udl */; };
1B9B8F0A26743B8800C8A918 /* uniffi_places-Bridging-Header.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B9B8F0826743B8800C8A918 /* uniffi_places-Bridging-Header.h */; settings = {ATTRIBUTES = (Public, ); }; };
1B9B8F0A26743B8800C8A918 /* placesFFI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B9B8F0826743B8800C8A918 /* placesFFI.h */; settings = {ATTRIBUTES = (Public, ); }; };
1B9B8F0B26743C8700C8A918 /* HistoryMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9FA8C532644A170008344BF /* HistoryMetadata.swift */; };
1BE78F46265322DB008B9A45 /* uniffi_logins-Bridging-Header.h in Headers */ = {isa = PBXBuildFile; fileRef = 1BE78F44265322DB008B9A45 /* uniffi_logins-Bridging-Header.h */; settings = {ATTRIBUTES = (Public, ); }; };
1BE78F46265322DB008B9A45 /* loginsFFI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1BE78F44265322DB008B9A45 /* loginsFFI.h */; settings = {ATTRIBUTES = (Public, ); }; };
1BE78F4926532325008B9A45 /* logins.udl in Sources */ = {isa = PBXBuildFile; fileRef = 1BE78F4826532325008B9A45 /* logins.udl */; };
394A807825EE951D00FAF26F /* uniffi_nimbus-Bridging-Header.h in Headers */ = {isa = PBXBuildFile; fileRef = 394A807625EE951D00FAF26F /* uniffi_nimbus-Bridging-Header.h */; settings = {ATTRIBUTES = (Public, ); }; };
394A807825EE951D00FAF26F /* nimbusFFI.h in Headers */ = {isa = PBXBuildFile; fileRef = 394A807625EE951D00FAF26F /* nimbusFFI.h */; settings = {ATTRIBUTES = (Public, ); }; };
394A809825F94E1300FAF26F /* Nimbus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 394A809725F94E1300FAF26F /* Nimbus.swift */; };
394D6C622600E64E008F9CE5 /* NimbusCreate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 394D6C612600E64E008F9CE5 /* NimbusCreate.swift */; };
395992B625FBC91500E3185F /* NimbusTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 395992B525FBC91500E3185F /* NimbusTests.swift */; };
@ -20,11 +20,11 @@
398A4149264986E200AA22F1 /* FeatureVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = 398A4148264986E200AA22F1 /* FeatureVariables.swift */; };
39C13795264DAAB6003DC662 /* NimbusFeatureVariablesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39C13794264DAAB6003DC662 /* NimbusFeatureVariablesTests.swift */; };
9908639E25F9CC5F00032083 /* crashtest.udl in Sources */ = {isa = PBXBuildFile; fileRef = 9908639B25F9CC3600032083 /* crashtest.udl */; };
990863A125F9D25A00032083 /* uniffi_crashtest-Bridging-Header.h in Headers */ = {isa = PBXBuildFile; fileRef = 9908639F25F9D25A00032083 /* uniffi_crashtest-Bridging-Header.h */; settings = {ATTRIBUTES = (Public, ); }; };
990863A125F9D25A00032083 /* crashtestFFI.h in Headers */ = {isa = PBXBuildFile; fileRef = 9908639F25F9D25A00032083 /* crashtestFFI.h */; settings = {ATTRIBUTES = (Public, ); }; };
990863A425F9D48400032083 /* CrashTestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 990863A325F9D48400032083 /* CrashTestTests.swift */; };
9924024A25F789F200841837 /* nimbus.udl in Sources */ = {isa = PBXBuildFile; fileRef = 394A807325EE94C600FAF26F /* nimbus.udl */; };
993D6D4F26B11E410075A820 /* SyncUnlockInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 993D6D4E26B11E400075A820 /* SyncUnlockInfo.swift */; };
99FAA19B25E61D5D001E2231 /* uniffi_fxa_client-Bridging-Header.h in Headers */ = {isa = PBXBuildFile; fileRef = 99FAA19A25E61D5D001E2231 /* uniffi_fxa_client-Bridging-Header.h */; settings = {ATTRIBUTES = (Public, ); }; };
99FAA19B25E61D5D001E2231 /* fxa_clientFFI.h in Headers */ = {isa = PBXBuildFile; fileRef = 99FAA19A25E61D5D001E2231 /* fxa_clientFFI.h */; settings = {ATTRIBUTES = (Public, ); }; };
99FAA19F25E65CA5001E2231 /* FxAccountOAuth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99FAA19E25E65CA5001E2231 /* FxAccountOAuth.swift */; };
BF1A879025064A4C00FED88E /* Dispatchers.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF1A878C25064A4C00FED88E /* Dispatchers.swift */; };
BF1A879125064A4C00FED88E /* Glean.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF1A878D25064A4C00FED88E /* Glean.swift */; };
@ -114,7 +114,7 @@
isEditable = 1;
outputFiles = (
"$(INPUT_FILE_DIR)/../ios/Generated/$(INPUT_FILE_BASE).swift",
"$(INPUT_FILE_DIR)/../ios/Generated/uniffi_$(INPUT_FILE_BASE)-Bridging-Header.h",
"$(INPUT_FILE_DIR)/../ios/Generated/$(INPUT_FILE_BASE)FFI.h",
);
script = "bash $PWD/../../build-scripts/xc-cargo.sh uniffi-bindgen generate $INPUT_FILE_PATH --language swift --out-dir $INPUT_FILE_DIR/../ios/Generated\n";
};
@ -160,11 +160,11 @@
/* Begin PBXFileReference section */
1B9B8EFE267439CC00C8A918 /* places.udl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = places.udl; path = ../../src/places.udl; sourceTree = "<group>"; };
1B9B8F0726743B8800C8A918 /* places.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = places.swift; path = ../../Generated/places.swift; sourceTree = "<group>"; };
1B9B8F0826743B8800C8A918 /* uniffi_places-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "uniffi_places-Bridging-Header.h"; path = "../../Generated/uniffi_places-Bridging-Header.h"; sourceTree = "<group>"; };
1BE78F44265322DB008B9A45 /* uniffi_logins-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "uniffi_logins-Bridging-Header.h"; sourceTree = "<group>"; };
1B9B8F0826743B8800C8A918 /* placesFFI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "placesFFI.h"; path = "../../Generated/placesFFI.h"; sourceTree = "<group>"; };
1BE78F44265322DB008B9A45 /* loginsFFI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "loginsFFI.h"; sourceTree = "<group>"; };
1BE78F4826532325008B9A45 /* logins.udl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = logins.udl; path = ../../src/logins.udl; sourceTree = "<group>"; };
394A807325EE94C600FAF26F /* nimbus.udl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = nimbus.udl; path = ../../src/nimbus.udl; sourceTree = "<group>"; };
394A807625EE951D00FAF26F /* uniffi_nimbus-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "uniffi_nimbus-Bridging-Header.h"; sourceTree = "<group>"; };
394A807625EE951D00FAF26F /* nimbusFFI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "nimbusFFI.h"; sourceTree = "<group>"; };
394A807725EE951D00FAF26F /* nimbus.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = nimbus.swift; sourceTree = "<group>"; };
394A809725F94E1300FAF26F /* Nimbus.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Nimbus.swift; sourceTree = "<group>"; };
394D6C612600E64E008F9CE5 /* NimbusCreate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NimbusCreate.swift; sourceTree = "<group>"; };
@ -173,12 +173,12 @@
398A4148264986E200AA22F1 /* FeatureVariables.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureVariables.swift; sourceTree = "<group>"; };
39C13794264DAAB6003DC662 /* NimbusFeatureVariablesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NimbusFeatureVariablesTests.swift; sourceTree = "<group>"; };
9908639B25F9CC3600032083 /* crashtest.udl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = crashtest.udl; path = ../../src/crashtest.udl; sourceTree = "<group>"; };
9908639F25F9D25A00032083 /* uniffi_crashtest-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "uniffi_crashtest-Bridging-Header.h"; sourceTree = "<group>"; };
9908639F25F9D25A00032083 /* crashtestFFI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "crashtestFFI.h"; sourceTree = "<group>"; };
990863A025F9D25A00032083 /* crashtest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = crashtest.swift; sourceTree = "<group>"; };
990863A325F9D48400032083 /* CrashTestTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CrashTestTests.swift; sourceTree = "<group>"; };
993D6D4E26B11E400075A820 /* SyncUnlockInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyncUnlockInfo.swift; sourceTree = "<group>"; };
99FAA19125E60D57001E2231 /* fxa_client.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = fxa_client.swift; sourceTree = "<group>"; };
99FAA19A25E61D5D001E2231 /* uniffi_fxa_client-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "uniffi_fxa_client-Bridging-Header.h"; sourceTree = "<group>"; };
99FAA19A25E61D5D001E2231 /* fxa_clientFFI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "fxa_clientFFI.h"; sourceTree = "<group>"; };
99FAA19E25E65CA5001E2231 /* FxAccountOAuth.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FxAccountOAuth.swift; sourceTree = "<group>"; };
BF1A878C25064A4C00FED88E /* Dispatchers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Dispatchers.swift; sourceTree = "<group>"; };
BF1A878D25064A4C00FED88E /* Glean.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Glean.swift; sourceTree = "<group>"; };
@ -288,7 +288,7 @@
isa = PBXGroup;
children = (
1B9B8F0726743B8800C8A918 /* places.swift */,
1B9B8F0826743B8800C8A918 /* uniffi_places-Bridging-Header.h */,
1B9B8F0826743B8800C8A918 /* placesFFI.h */,
);
path = Generated;
sourceTree = "<group>";
@ -296,7 +296,7 @@
1BE78F42265322DB008B9A45 /* Generated */ = {
isa = PBXGroup;
children = (
1BE78F44265322DB008B9A45 /* uniffi_logins-Bridging-Header.h */,
1BE78F44265322DB008B9A45 /* loginsFFI.h */,
);
name = Generated;
path = ../Generated;
@ -319,7 +319,7 @@
394A807525EE951D00FAF26F /* Generated */ = {
isa = PBXGroup;
children = (
394A807625EE951D00FAF26F /* uniffi_nimbus-Bridging-Header.h */,
394A807625EE951D00FAF26F /* nimbusFFI.h */,
394A807725EE951D00FAF26F /* nimbus.swift */,
);
name = Generated;
@ -340,7 +340,7 @@
isa = PBXGroup;
children = (
990863A025F9D25A00032083 /* crashtest.swift */,
9908639F25F9D25A00032083 /* uniffi_crashtest-Bridging-Header.h */,
9908639F25F9D25A00032083 /* crashtestFFI.h */,
);
name = Generated;
path = ../Generated;
@ -359,7 +359,7 @@
99FAA19025E60D2C001E2231 /* Generated */ = {
isa = PBXGroup;
children = (
99FAA19A25E61D5D001E2231 /* uniffi_fxa_client-Bridging-Header.h */,
99FAA19A25E61D5D001E2231 /* fxa_clientFFI.h */,
99FAA19125E60D57001E2231 /* fxa_client.swift */,
);
name = Generated;
@ -640,11 +640,11 @@
CE58B2F8242D54340089F091 /* RustViaductFFI.h in Headers */,
CD85A45522361E890099BFA9 /* RustPlacesAPI.h in Headers */,
BF1A879225064A4C00FED88E /* GleanFfi.h in Headers */,
990863A125F9D25A00032083 /* uniffi_crashtest-Bridging-Header.h in Headers */,
99FAA19B25E61D5D001E2231 /* uniffi_fxa_client-Bridging-Header.h in Headers */,
1B9B8F0A26743B8800C8A918 /* uniffi_places-Bridging-Header.h in Headers */,
1BE78F46265322DB008B9A45 /* uniffi_logins-Bridging-Header.h in Headers */,
394A807825EE951D00FAF26F /* uniffi_nimbus-Bridging-Header.h in Headers */,
990863A125F9D25A00032083 /* crashtestFFI.h in Headers */,
99FAA19B25E61D5D001E2231 /* fxa_clientFFI.h in Headers */,
1B9B8F0A26743B8800C8A918 /* placesFFI.h in Headers */,
1BE78F46265322DB008B9A45 /* loginsFFI.h in Headers */,
394A807825EE951D00FAF26F /* nimbusFFI.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};

Просмотреть файл

@ -7,4 +7,4 @@ license = "MPL-2.0"
[dependencies]
anyhow = "1"
uniffi_bindgen = "^0.12"
uniffi_bindgen = "^0.14"