Introduces `@mozilla.org/security/lockstore;1` implementing nsILockstore,
a singleton that opens the per-profile Lockstore keystore lazily and
exposes the Lockstore surface to:
* JS via DOM Promises (`nsILockstore` IDL methods), dispatched off
the main thread through a single `ImplXpcomMethod` template that
runs the sync method on a background task and bridges the result
to the DOM Promise.
* In-tree off-main-thread C++ consumers via synchronous `Do*`
methods that take `mMutex`, ensure the keystore is open, call
the FFI, and return `nsresult` or `Result<T, nsresult>`. Debug
builds assert off-main-thread; callers on the main thread wrap
with `NS_DispatchBackgroundTask`.
`mMutex` is the only serialisation point — concurrent JS-via-XPCOM
and C++ direct callers queue on it, so no dedicated background
event target is needed.
Differential Revision: https://phabricator.services.mozilla.com/D296183
15 lines
534 B
Plaintext
15 lines
534 B
Plaintext
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
Classes = [
|
|
{
|
|
"cid": "{0ba81119-3b86-44f5-9de7-322d96e13627}",
|
|
"contract_ids": ["@mozilla.org/security/lockstore;1"],
|
|
"type": "mozilla::security::lockstore::LockstoreService",
|
|
"headers": ["/security/lockstore/LockstoreService.h"],
|
|
"init_method": "Init",
|
|
"singleton": True,
|
|
},
|
|
]
|