Граф коммитов

10 Коммитов

Автор SHA1 Сообщение Дата
Lina Cambridge 534fd0e715 Bug 1622949 - Add `HashPropertyBag::clone_from_bag`. r=froydnj
`clone_from_bag` lets Rust code create a thread-safe `HashPropertyBag`
from any kind of `nsIPropertyBag` by cloning its contents. This is
important when you want to use a property bag that's passed to an XPIDL
method off the main thread. An `nsIPropertyBag` passed from JS isn't
thread-safe, since it's cycle-collected, and its properties are
`XPCVariant`s. But a Rust `HashPropertyBag` is, because it's backed by
a non-cycle collected `nsHashPropertyBag`, and the only supported
properties are thread-safe storage variants.

It also marks `HashPropertyBag` as `Send + Sync`, given that the only
way to construct one is through `HashPropertyBag::new`, and
`VariantType` is only implemented for storage variants.

Finally, it adds more type tags for string (narrow and wide) variants,
and changes the `VariantType for nsCString` getter to use
`GetAsAUTF8String`, since that's what mozStorage implements for its
text variant, not `GetAsACString`.

Differential Revision: https://phabricator.services.mozilla.com/D67075

--HG--
extra : moz-landing-system : lando
2020-03-17 23:33:45 +00:00
Sylvestre Ledru 7ba14f1431 Bug 1617369 - Reformat storage/variant/ using rustfmt r=lina
Depends on D64871

Differential Revision: https://phabricator.services.mozilla.com/D64872

--HG--
extra : moz-landing-system : lando
2020-03-02 15:48:30 +00:00
Lina Cambridge 065c7d61d2 Bug 1582379 - Include more context in Rust mozStorage errors. r=tcsc
A low-frequency error that showed up in telemetry for new bookmark
sync is "Storage operation failed with NS_ERROR_CANNOT_CONVERT_DATA",
which occurs when we try to convert a variant to the wrong type. It
would be helpful to include the type and column names for this case;
for example, "Can't get i32 for column lastModified". Neither the type
nor column name are PII; we want them to show up in telemetry.

Differential Revision: https://phabricator.services.mozilla.com/D46433

--HG--
extra : moz-landing-system : lando
2019-09-19 21:16:59 +00:00
Mike Hommey 103c1bec20 Bug 1567739 - Stop using deprecated rust libc integer types in storage_variant and kvstore. r=lina
Differential Revision: https://phabricator.services.mozilla.com/D38940

--HG--
extra : moz-landing-system : lando
2019-07-23 00:13:43 +00:00
Lina Cambridge 3e894ac30e Bug 1482608 - Add basic Rust bindings for mozStorage. r=nika,asuth,mak
This commit wraps just enough of the mozStorage API to support the
bookmarks mirror. It's not complete: for example, there's no way
to open, clone, or close a connection, because the mirror handles
that from JS. The wrapper also omits shutdown blocking and retrying on
`SQLITE_BUSY`.

This commit also changes the behavior of sync and async mozStorage
connections. Async (`mozIStorageAsyncConnection`) methods may be called
from any thread on any connection. Sync (`mozIStorageConnection`)
methods may be called from any thread on a sync connection, and from
background threads on an async connection. All connections now QI
to `mozIStorageConnection`, but attempting to call a sync method on
an async connection from the main thread throws.

Finally, this commit exposes an `OpenedConnection::unsafeRawConnection`
getter in Sqlite.jsm, for JS code to access the underlying connection.

Differential Revision: https://phabricator.services.mozilla.com/D20073

--HG--
extra : moz-landing-system : lando
2019-03-25 04:49:18 +00:00
Lina Cambridge 8f82f61df9 Bug 1530506 - Add a generic writable property bag wrapper for Rust code. r=nika
This commit adds a `storage_variant::HashPropertyBag` type that
exposes an idiomatic Rust interface for `nsIWritablePropertyBag`.

Differential Revision: https://phabricator.services.mozilla.com/D21062

--HG--
extra : moz-landing-system : lando
2019-02-26 21:53:32 +00:00
Nika Layzell f2d9e32b48 Bug 1530028 - Remove now-unnecessary NsresultExt trait, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D20880

--HG--
extra : moz-landing-system : lando
2019-02-25 15:50:14 +00:00
Gurzau Raul fbe889dd73 Backed out changeset f18666cc5793 (bug 1530028) for build bustages on a CLOSED TREE. 2019-02-25 16:55:00 +02:00
Nika Layzell f4b66e3031 Bug 1530028 - Remove now-unnecessary NsresultExt trait, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D20880

--HG--
extra : moz-landing-system : lando
2019-02-25 00:23:17 +00:00
Myk Melez 4db9ccb1af Bug 1490496 - implement XPCOM FFI for key-value storage r=nika,lina,mossop
MozReview-Commit-ID: JnQzXG581DW

Differential Revision: https://phabricator.services.mozilla.com/D6328

--HG--
rename : third_party/rust/crossbeam-utils/.cargo-checksum.json => third_party/rust/crossbeam-utils-0.3.2/.cargo-checksum.json
rename : third_party/rust/crossbeam-utils/CHANGELOG.md => third_party/rust/crossbeam-utils-0.3.2/CHANGELOG.md
rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/crossbeam-utils-0.3.2/Cargo.toml
rename : third_party/rust/crossbeam-utils/LICENSE-MIT => third_party/rust/crossbeam-utils-0.3.2/LICENSE-MIT
rename : third_party/rust/crossbeam-utils/README.md => third_party/rust/crossbeam-utils-0.3.2/README.md
rename : third_party/rust/crossbeam-utils/src/cache_padded.rs => third_party/rust/crossbeam-utils-0.3.2/src/cache_padded.rs
rename : third_party/rust/crossbeam-utils/src/consume.rs => third_party/rust/crossbeam-utils-0.3.2/src/consume.rs
rename : third_party/rust/crossbeam-utils/src/lib.rs => third_party/rust/crossbeam-utils-0.3.2/src/lib.rs
rename : third_party/rust/crossbeam-utils/src/scoped.rs => third_party/rust/crossbeam-utils-0.3.2/src/scoped.rs
rename : third_party/rust/crossbeam-utils/src/consume.rs => third_party/rust/crossbeam-utils/src/atomic/consume.rs
rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/threadbound/Cargo.toml
rename : third_party/rust/crossbeam-utils/LICENSE-MIT => third_party/rust/threadbound/LICENSE-MIT
rename : third_party/rust/uuid/.cargo-checksum.json => third_party/rust/uuid-0.6.5/.cargo-checksum.json
rename : third_party/rust/uuid/CODE_OF_CONDUCT.md => third_party/rust/uuid-0.6.5/CODE_OF_CONDUCT.md
rename : third_party/rust/uuid/Cargo.toml => third_party/rust/uuid-0.6.5/Cargo.toml
rename : third_party/rust/crossbeam-utils/LICENSE-MIT => third_party/rust/uuid-0.6.5/LICENSE-MIT
rename : third_party/rust/uuid/README.md => third_party/rust/uuid-0.6.5/README.md
rename : third_party/rust/uuid/benches/parse_str.rs => third_party/rust/uuid-0.6.5/benches/parse_str.rs
rename : third_party/rust/uuid/src/adapter.rs => third_party/rust/uuid-0.6.5/src/adapter.rs
rename : third_party/rust/uuid/src/core_support.rs => third_party/rust/uuid-0.6.5/src/core_support.rs
rename : third_party/rust/uuid/src/lib.rs => third_party/rust/uuid-0.6.5/src/lib.rs
rename : third_party/rust/uuid/src/prelude.rs => third_party/rust/uuid-0.6.5/src/prelude.rs
rename : third_party/rust/uuid/src/serde_support.rs => third_party/rust/uuid-0.6.5/src/serde_support.rs
rename : third_party/rust/uuid/src/slog_support.rs => third_party/rust/uuid-0.6.5/src/slog_support.rs
rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid-0.6.5/src/std_support.rs
rename : third_party/rust/uuid/src/test_util.rs => third_party/rust/uuid-0.6.5/src/test_util.rs
rename : third_party/rust/uuid/src/u128_support.rs => third_party/rust/uuid-0.6.5/src/u128_support.rs
rename : third_party/rust/uuid/benches/parse_str.rs => third_party/rust/uuid/benches/invalid_parse_str.rs
rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid/src/parser/std_support.rs
extra : moz-landing-system : lando
2019-02-07 16:14:04 +00:00