forked from mirrors/gecko-dev
Bug 1900667 - Fix formatting in dom/quota; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D212591
This commit is contained in:
parent
cc6a87da40
commit
b8962bf2de
3 changed files with 36 additions and 40 deletions
|
|
@ -39,7 +39,7 @@ class CipherKeyManager {
|
|||
using CipherKey = typename CipherStrategy::KeyType;
|
||||
|
||||
public:
|
||||
explicit CipherKeyManager(const char* aName) : mCipherKeys(aName){};
|
||||
explicit CipherKeyManager(const char* aName) : mCipherKeys(aName) {};
|
||||
|
||||
Maybe<CipherKey> Get(const nsACString& aKeyId = "default"_ns) {
|
||||
auto lockedCipherKeys = mCipherKeys.Lock();
|
||||
|
|
|
|||
|
|
@ -21,8 +21,10 @@ using std::begin;
|
|||
using std::end;
|
||||
|
||||
template <typename T, typename NestedRange>
|
||||
auto Flatten(NestedRange&& aRange) -> std::enable_if_t<
|
||||
std::is_same_v<T, std::decay_t<typename decltype(begin(
|
||||
auto Flatten(NestedRange&& aRange)
|
||||
-> std::enable_if_t<
|
||||
std::is_same_v<T,
|
||||
std::decay_t<typename decltype(begin(
|
||||
std::declval<const NestedRange&>()))::value_type>>,
|
||||
std::conditional_t<std::is_rvalue_reference_v<NestedRange>,
|
||||
std::decay_t<NestedRange>, NestedRange>> {
|
||||
|
|
@ -98,10 +100,11 @@ struct FlatRange {
|
|||
};
|
||||
|
||||
template <typename T, typename NestedRange>
|
||||
auto Flatten(NestedRange&& aRange) -> std::enable_if_t<
|
||||
!std::is_same_v<
|
||||
T, std::decay_t<typename decltype(begin(
|
||||
std::declval<const std::decay_t<NestedRange>&>()))::value_type>>,
|
||||
auto Flatten(NestedRange&& aRange)
|
||||
-> std::enable_if_t<
|
||||
!std::is_same_v<T, std::decay_t<typename decltype(begin(
|
||||
std::declval<const std::decay_t<
|
||||
NestedRange>&>()))::value_type>>,
|
||||
FlatRange<T, NestedRange>> {
|
||||
return FlatRange<T, NestedRange>{std::forward<NestedRange>(aRange)};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -590,14 +590,12 @@ struct IpcFailCustomRetVal {
|
|||
// See also
|
||||
// https://stackoverflow.com/questions/3046889/optional-parameters-with-c-macros
|
||||
#define QM_TRY_META(...) \
|
||||
{ \
|
||||
MOZ_ARG_7(, ##__VA_ARGS__, \
|
||||
{MOZ_ARG_7(, ##__VA_ARGS__, \
|
||||
QM_TRY_CUSTOM_RET_VAL_WITH_CLEANUP_AND_PREDICATE(__VA_ARGS__), \
|
||||
QM_TRY_CUSTOM_RET_VAL_WITH_CLEANUP(__VA_ARGS__), \
|
||||
QM_TRY_CUSTOM_RET_VAL(__VA_ARGS__), \
|
||||
QM_TRY_PROPAGATE_ERR(__VA_ARGS__), QM_MISSING_ARGS(__VA_ARGS__), \
|
||||
QM_MISSING_ARGS(__VA_ARGS__)) \
|
||||
}
|
||||
QM_MISSING_ARGS(__VA_ARGS__))}
|
||||
|
||||
// Generates unique variable name. This extra internal macro (along with
|
||||
// __COUNTER__) allows nesting of the final macro.
|
||||
|
|
@ -746,13 +744,11 @@ struct IpcFailCustomRetVal {
|
|||
// Chooses the final implementation macro for given argument count.
|
||||
// See also the comment for QM_TRY_META.
|
||||
#define QM_TRY_RETURN_META(...) \
|
||||
{ \
|
||||
MOZ_ARG_6(, ##__VA_ARGS__, \
|
||||
{MOZ_ARG_6(, ##__VA_ARGS__, \
|
||||
QM_TRY_RETURN_CUSTOM_RET_VAL_WITH_CLEANUP(__VA_ARGS__), \
|
||||
QM_TRY_RETURN_CUSTOM_RET_VAL(__VA_ARGS__), \
|
||||
QM_TRY_RETURN_PROPAGATE_ERR(__VA_ARGS__), \
|
||||
QM_MISSING_ARGS(__VA_ARGS__), QM_MISSING_ARGS(__VA_ARGS__)) \
|
||||
}
|
||||
QM_MISSING_ARGS(__VA_ARGS__), QM_MISSING_ARGS(__VA_ARGS__))}
|
||||
|
||||
// Generates unique variable name. This extra internal macro (along with
|
||||
// __COUNTER__) allows nesting of the final macro.
|
||||
|
|
@ -827,11 +823,9 @@ struct IpcFailCustomRetVal {
|
|||
// Chooses the final implementation macro for given argument count.
|
||||
// See also the comment for QM_TRY_META.
|
||||
#define QM_REPORTONLY_TRY_META(...) \
|
||||
{ \
|
||||
MOZ_ARG_6(, ##__VA_ARGS__, QM_REPORTONLY_TRY_WITH_CLEANUP(__VA_ARGS__), \
|
||||
{MOZ_ARG_6(, ##__VA_ARGS__, QM_REPORTONLY_TRY_WITH_CLEANUP(__VA_ARGS__), \
|
||||
QM_REPORTONLY_TRY(__VA_ARGS__), QM_MISSING_ARGS(__VA_ARGS__), \
|
||||
QM_MISSING_ARGS(__VA_ARGS__), QM_MISSING_ARGS(__VA_ARGS__)) \
|
||||
}
|
||||
QM_MISSING_ARGS(__VA_ARGS__), QM_MISSING_ARGS(__VA_ARGS__))}
|
||||
|
||||
// Generates unique variable name. This extra internal macro (along with
|
||||
// __COUNTER__) allows nesting of the final macro.
|
||||
|
|
@ -1134,8 +1128,8 @@ auto ErrToDefaultOk(const nsresult aValue) -> Result<V, nsresult> {
|
|||
}
|
||||
|
||||
template <typename MozPromiseType, typename RejectValueT = nsresult>
|
||||
auto CreateAndRejectMozPromise(StaticString aFunc, const RejectValueT& aRv)
|
||||
-> decltype(auto) {
|
||||
auto CreateAndRejectMozPromise(StaticString aFunc,
|
||||
const RejectValueT& aRv) -> decltype(auto) {
|
||||
if constexpr (std::is_same_v<RejectValueT, nsresult>) {
|
||||
return MozPromiseType::CreateAndReject(aRv, aFunc);
|
||||
} else if constexpr (std::is_same_v<RejectValueT, QMResult>) {
|
||||
|
|
@ -1227,8 +1221,8 @@ auto Reduce(Range&& aRange, T aInit, const BinaryOp& aBinaryOp) {
|
|||
}
|
||||
|
||||
template <typename Range, typename Body>
|
||||
auto CollectEachInRange(Range&& aRange, const Body& aBody)
|
||||
-> Result<mozilla::Ok, nsresult> {
|
||||
auto CollectEachInRange(Range&& aRange,
|
||||
const Body& aBody) -> Result<mozilla::Ok, nsresult> {
|
||||
for (auto&& element : aRange) {
|
||||
MOZ_TRY(aBody(element));
|
||||
}
|
||||
|
|
@ -1624,8 +1618,7 @@ Result<mozilla::Ok, nsresult> CollectEachFile(nsIFile& aDirectory,
|
|||
template <typename Body>
|
||||
Result<mozilla::Ok, nsresult> CollectEachFile(nsIFile& aDirectory,
|
||||
const Body& aBody) {
|
||||
return detail::CollectEachFile(
|
||||
aDirectory, [] { return false; }, aBody);
|
||||
return detail::CollectEachFile(aDirectory, [] { return false; }, aBody);
|
||||
}
|
||||
|
||||
template <typename Body>
|
||||
|
|
|
|||
Loading…
Reference in a new issue