зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 50af9d58c645 (bug 1619592) for causing build bustages in /builds/worker/checkouts/gecko/dom/quota/PersistenceType.cpp CLOSED TREE
This commit is contained in:
Родитель
0b1a68a2ad
Коммит
0b7c33c8d9
|
@ -2930,10 +2930,8 @@ nsDOMWindowUtils::GetFileReferences(const nsAString& aDatabaseName, int64_t aId,
|
|||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
const quota::PersistenceType persistenceType =
|
||||
options.mStorage.WasPassed()
|
||||
? quota::PersistenceTypeFromStorageType(options.mStorage.Value())
|
||||
: quota::PERSISTENCE_TYPE_DEFAULT;
|
||||
quota::PersistenceType persistenceType =
|
||||
quota::PersistenceTypeFromStorage(options.mStorage);
|
||||
|
||||
RefPtr<IndexedDatabaseManager> mgr = IndexedDatabaseManager::Get();
|
||||
|
||||
|
|
|
@ -13693,7 +13693,7 @@ void Database::Stringify(nsACString& aResult) const {
|
|||
aResult.Append(kQuotaGenericDelimiter);
|
||||
|
||||
aResult.AppendLiteral("PersistenceType:");
|
||||
aResult.Append(PersistenceTypeToString(mPersistenceType));
|
||||
aResult.Append(PersistenceTypeString(mPersistenceType));
|
||||
aResult.Append(kQuotaGenericDelimiter);
|
||||
|
||||
aResult.AppendLiteral("Closed:");
|
||||
|
@ -18086,7 +18086,7 @@ nsresult Maintenance::DirectoryWork() {
|
|||
// XXX This shouldn't be a special case...
|
||||
persistenceTypeString.AssignLiteral("permanent");
|
||||
} else {
|
||||
persistenceTypeString.Assign(PersistenceTypeToString(persistenceType));
|
||||
PersistenceTypeToText(persistenceType, persistenceTypeString);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFile> persistenceDir;
|
||||
|
@ -18511,7 +18511,7 @@ void DatabaseMaintenance::Stringify(nsACString& aResult) const {
|
|||
aResult.Append(kQuotaGenericDelimiter);
|
||||
|
||||
aResult.AppendLiteral("PersistenceType:");
|
||||
aResult.Append(PersistenceTypeToString(mPersistenceType));
|
||||
aResult.Append(PersistenceTypeString(mPersistenceType));
|
||||
aResult.Append(kQuotaGenericDelimiter);
|
||||
|
||||
aResult.AppendLiteral("Duration:");
|
||||
|
@ -20314,7 +20314,7 @@ void FactoryOp::Stringify(nsACString& aResult) const {
|
|||
|
||||
aResult.AppendLiteral("PersistenceType:");
|
||||
aResult.Append(
|
||||
PersistenceTypeToString(mCommonParams.metadata().persistenceType()));
|
||||
PersistenceTypeString(mCommonParams.metadata().persistenceType()));
|
||||
aResult.Append(kQuotaGenericDelimiter);
|
||||
|
||||
aResult.AppendLiteral("Origin:");
|
||||
|
|
|
@ -624,7 +624,7 @@ StorageType IDBDatabase::Storage() const {
|
|||
AssertIsOnOwningThread();
|
||||
MOZ_ASSERT(mSpec);
|
||||
|
||||
return PersistenceTypeToStorageType(mSpec->metadata().persistenceType());
|
||||
return PersistenceTypeToStorage(mSpec->metadata().persistenceType());
|
||||
}
|
||||
|
||||
RefPtr<IDBRequest> IDBDatabase::CreateMutableFile(
|
||||
|
|
|
@ -635,9 +635,8 @@ RefPtr<IDBOpenDBRequest> IDBFactory::OpenInternal(
|
|||
if (isInternal) {
|
||||
// Chrome privilege and internal origins always get persistent storage.
|
||||
persistenceType = PERSISTENCE_TYPE_PERSISTENT;
|
||||
} else if ((isAddon || StaticPrefs::dom_indexedDB_storageOption_enabled()) &&
|
||||
aStorageType.WasPassed()) {
|
||||
persistenceType = PersistenceTypeFromStorageType(aStorageType.Value());
|
||||
} else if (isAddon || StaticPrefs::dom_indexedDB_storageOption_enabled()) {
|
||||
persistenceType = PersistenceTypeFromStorage(aStorageType);
|
||||
} else {
|
||||
persistenceType = PERSISTENCE_TYPE_DEFAULT;
|
||||
}
|
||||
|
|
|
@ -2997,7 +2997,7 @@ void DirectoryLockImpl::Log() const {
|
|||
if (mPersistenceType.IsNull()) {
|
||||
persistenceType.AssignLiteral("null");
|
||||
} else {
|
||||
persistenceType.Assign(PersistenceTypeToString(mPersistenceType.Value()));
|
||||
PersistenceTypeToText(mPersistenceType.Value(), persistenceType);
|
||||
}
|
||||
QM_LOG((" mPersistenceType: %s", persistenceType.get()));
|
||||
|
||||
|
@ -4302,14 +4302,12 @@ nsresult QuotaManager::LoadQuota() {
|
|||
return rv;
|
||||
}
|
||||
|
||||
const auto maybePersistenceType =
|
||||
PersistenceTypeFromInt32(repositoryId, fallible);
|
||||
if (NS_WARN_IF(maybePersistenceType.isNothing())) {
|
||||
return NS_ERROR_FAILURE;
|
||||
PersistenceType persistenceType;
|
||||
rv = PersistenceTypeFromInt32(repositoryId, persistenceType);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
const PersistenceType persistenceType = maybePersistenceType.value();
|
||||
|
||||
nsCString origin;
|
||||
rv = stmt->GetUTF8String(1, origin);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
|
@ -6634,9 +6632,10 @@ nsresult QuotaManager::EnsureStorageIsInitialized() {
|
|||
return rv;
|
||||
}
|
||||
|
||||
rv = insertStmt->BindUTF8StringByName(
|
||||
NS_LITERAL_CSTRING("name"),
|
||||
PersistenceTypeToString(persistenceType));
|
||||
nsCString name;
|
||||
PersistenceTypeToText(persistenceType, name);
|
||||
|
||||
rv = insertStmt->BindUTF8StringByName(NS_LITERAL_CSTRING("name"), name);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -1,221 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#include "PersistenceType.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
namespace quota {
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr auto kPersistentString = NS_LITERAL_STRING("persistent");
|
||||
constexpr auto kTemporaryString = NS_LITERAL_STRING("temporary");
|
||||
constexpr auto kDefaultString = NS_LITERAL_STRING("default");
|
||||
|
||||
constexpr auto kPersistentCString = NS_LITERAL_CSTRING("persistent");
|
||||
constexpr auto kTemporaryCString = NS_LITERAL_CSTRING("temporary");
|
||||
constexpr auto kDefaultCString = NS_LITERAL_CSTRING("default");
|
||||
|
||||
static_assert(PERSISTENCE_TYPE_PERSISTENT == 0 &&
|
||||
PERSISTENCE_TYPE_TEMPORARY == 1 &&
|
||||
PERSISTENCE_TYPE_DEFAULT == 2 &&
|
||||
PERSISTENCE_TYPE_INVALID == 3,
|
||||
"Incorrect enum values!");
|
||||
|
||||
template <PersistenceType type>
|
||||
struct PersistenceTypeTraits;
|
||||
|
||||
template <>
|
||||
struct PersistenceTypeTraits<PERSISTENCE_TYPE_PERSISTENT> {
|
||||
template <typename T>
|
||||
static T To();
|
||||
|
||||
template <>
|
||||
nsLiteralString To<nsLiteralString>() {
|
||||
return kPersistentString;
|
||||
}
|
||||
|
||||
template <>
|
||||
nsLiteralCString To<nsLiteralCString>() {
|
||||
return kPersistentCString;
|
||||
}
|
||||
|
||||
template <>
|
||||
StorageType To<StorageType>() {
|
||||
return StorageType::Persistent;
|
||||
}
|
||||
|
||||
static bool From(const nsAString& aString) {
|
||||
return aString == kPersistentString;
|
||||
}
|
||||
|
||||
static bool From(const nsACString& aString) {
|
||||
return aString == kPersistentCString;
|
||||
}
|
||||
|
||||
static bool From(const StorageType aStorageType) {
|
||||
return aStorageType == StorageType::Persistent;
|
||||
}
|
||||
|
||||
static bool From(const int32_t aInt32) { return aInt32 == 0; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct PersistenceTypeTraits<PERSISTENCE_TYPE_TEMPORARY> {
|
||||
template <typename T>
|
||||
static T To();
|
||||
|
||||
template <>
|
||||
nsLiteralString To<nsLiteralString>() {
|
||||
return kTemporaryString;
|
||||
}
|
||||
|
||||
template <>
|
||||
nsLiteralCString To<nsLiteralCString>() {
|
||||
return kTemporaryCString;
|
||||
}
|
||||
|
||||
template <>
|
||||
StorageType To<StorageType>() {
|
||||
return StorageType::Temporary;
|
||||
}
|
||||
|
||||
static bool From(const nsAString& aString) {
|
||||
return aString == kTemporaryString;
|
||||
}
|
||||
|
||||
static bool From(const nsACString& aString) {
|
||||
return aString == kTemporaryCString;
|
||||
}
|
||||
|
||||
static bool From(const StorageType aStorageType) {
|
||||
return aStorageType == StorageType::Temporary;
|
||||
}
|
||||
|
||||
static bool From(const int32_t aInt32) { return aInt32 == 1; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct PersistenceTypeTraits<PERSISTENCE_TYPE_DEFAULT> {
|
||||
template <typename T>
|
||||
static T To();
|
||||
|
||||
template <>
|
||||
nsLiteralString To<nsLiteralString>() {
|
||||
return kDefaultString;
|
||||
}
|
||||
|
||||
template <>
|
||||
nsLiteralCString To<nsLiteralCString>() {
|
||||
return kDefaultCString;
|
||||
}
|
||||
|
||||
template <>
|
||||
StorageType To<StorageType>() {
|
||||
return StorageType::Default;
|
||||
}
|
||||
|
||||
static bool From(const nsAString& aString) {
|
||||
return aString == kDefaultString;
|
||||
}
|
||||
|
||||
static bool From(const nsACString& aString) {
|
||||
return aString == kDefaultCString;
|
||||
}
|
||||
|
||||
static bool From(const StorageType aStorageType) {
|
||||
return aStorageType == StorageType::Default;
|
||||
}
|
||||
|
||||
static bool From(const int32_t aInt32) { return aInt32 == 2; }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
Maybe<T> TypeTo_impl(const PersistenceType aPersistenceType) {
|
||||
switch (aPersistenceType) {
|
||||
case PERSISTENCE_TYPE_PERSISTENT:
|
||||
return Some(PersistenceTypeTraits<PERSISTENCE_TYPE_PERSISTENT>::To<T>());
|
||||
|
||||
case PERSISTENCE_TYPE_TEMPORARY:
|
||||
return Some(PersistenceTypeTraits<PERSISTENCE_TYPE_TEMPORARY>::To<T>());
|
||||
|
||||
case PERSISTENCE_TYPE_DEFAULT:
|
||||
return Some(PersistenceTypeTraits<PERSISTENCE_TYPE_DEFAULT>::To<T>());
|
||||
|
||||
default:
|
||||
return Nothing();
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
Maybe<PersistenceType> TypeFrom_impl(const T& aData) {
|
||||
if (PersistenceTypeTraits<PERSISTENCE_TYPE_PERSISTENT>::From(aData)) {
|
||||
return Some(PERSISTENCE_TYPE_PERSISTENT);
|
||||
}
|
||||
|
||||
if (PersistenceTypeTraits<PERSISTENCE_TYPE_TEMPORARY>::From(aData)) {
|
||||
return Some(PERSISTENCE_TYPE_TEMPORARY);
|
||||
}
|
||||
|
||||
if (PersistenceTypeTraits<PERSISTENCE_TYPE_DEFAULT>::From(aData)) {
|
||||
return Some(PERSISTENCE_TYPE_DEFAULT);
|
||||
}
|
||||
|
||||
return Nothing();
|
||||
}
|
||||
|
||||
void BadPersistenceType() { MOZ_CRASH("Bad persistence type value!"); }
|
||||
|
||||
} // namespace
|
||||
|
||||
nsLiteralCString PersistenceTypeToString(
|
||||
const PersistenceType aPersistenceType) {
|
||||
const auto maybeString = TypeTo_impl<nsLiteralCString>(aPersistenceType);
|
||||
if (maybeString.isNothing()) {
|
||||
BadPersistenceType();
|
||||
}
|
||||
return maybeString.value();
|
||||
}
|
||||
|
||||
Maybe<PersistenceType> PersistenceTypeFromString(const nsACString& aString,
|
||||
const fallible_t&) {
|
||||
return TypeFrom_impl(aString);
|
||||
}
|
||||
|
||||
PersistenceType PersistenceTypeFromString(const nsACString& aString) {
|
||||
const auto maybePersistenceType = TypeFrom_impl(aString);
|
||||
if (maybePersistenceType.isNothing()) {
|
||||
BadPersistenceType();
|
||||
}
|
||||
return maybePersistenceType.value();
|
||||
}
|
||||
|
||||
StorageType PersistenceTypeToStorageType(
|
||||
const PersistenceType aPersistenceType) {
|
||||
const auto maybeStorageType = TypeTo_impl<StorageType>(aPersistenceType);
|
||||
if (maybeStorageType.isNothing()) {
|
||||
BadPersistenceType();
|
||||
}
|
||||
return maybeStorageType.value();
|
||||
}
|
||||
|
||||
PersistenceType PersistenceTypeFromStorageType(const StorageType aStorageType) {
|
||||
const auto maybePersistenceType = TypeFrom_impl(aStorageType);
|
||||
if (maybePersistenceType.isNothing()) {
|
||||
BadPersistenceType();
|
||||
}
|
||||
return maybePersistenceType.value();
|
||||
}
|
||||
|
||||
Maybe<PersistenceType> PersistenceTypeFromInt32(const int32_t aInt32,
|
||||
const fallible_t&) {
|
||||
return TypeFrom_impl(aInt32);
|
||||
}
|
||||
|
||||
} // namespace quota
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
|
@ -29,22 +29,104 @@ static const PersistenceType kAllPersistenceTypes[] = {
|
|||
PERSISTENCE_TYPE_PERSISTENT, PERSISTENCE_TYPE_TEMPORARY,
|
||||
PERSISTENCE_TYPE_DEFAULT};
|
||||
|
||||
nsLiteralCString PersistenceTypeToString(PersistenceType aPersistenceType);
|
||||
inline void PersistenceTypeToText(PersistenceType aPersistenceType,
|
||||
nsACString& aText) {
|
||||
switch (aPersistenceType) {
|
||||
case PERSISTENCE_TYPE_PERSISTENT:
|
||||
aText.AssignLiteral("persistent");
|
||||
return;
|
||||
case PERSISTENCE_TYPE_TEMPORARY:
|
||||
aText.AssignLiteral("temporary");
|
||||
return;
|
||||
case PERSISTENCE_TYPE_DEFAULT:
|
||||
aText.AssignLiteral("default");
|
||||
return;
|
||||
|
||||
Maybe<PersistenceType> PersistenceTypeFromString(const nsACString& aString,
|
||||
const fallible_t&);
|
||||
case PERSISTENCE_TYPE_INVALID:
|
||||
default:
|
||||
MOZ_CRASH("Bad persistence type value!");
|
||||
}
|
||||
}
|
||||
|
||||
PersistenceType PersistenceTypeFromString(const nsACString& aString);
|
||||
class PersistenceTypeString : public nsCString {
|
||||
public:
|
||||
explicit PersistenceTypeString(PersistenceType aPersistenceType) {
|
||||
PersistenceTypeToText(aPersistenceType, *this);
|
||||
}
|
||||
};
|
||||
|
||||
StorageType PersistenceTypeToStorageType(PersistenceType aPersistenceType);
|
||||
inline PersistenceType PersistenceTypeFromText(const nsACString& aText) {
|
||||
if (aText.EqualsLiteral("persistent")) {
|
||||
return PERSISTENCE_TYPE_PERSISTENT;
|
||||
}
|
||||
|
||||
PersistenceType PersistenceTypeFromStorageType(StorageType aStorageType);
|
||||
if (aText.EqualsLiteral("temporary")) {
|
||||
return PERSISTENCE_TYPE_TEMPORARY;
|
||||
}
|
||||
|
||||
Maybe<PersistenceType> PersistenceTypeFromInt32(int32_t aInt32,
|
||||
const fallible_t&);
|
||||
if (aText.EqualsLiteral("default")) {
|
||||
return PERSISTENCE_TYPE_DEFAULT;
|
||||
}
|
||||
|
||||
MOZ_CRASH("Should never get here!");
|
||||
}
|
||||
|
||||
inline nsresult PersistenceTypeFromInt32(int32_t aInt,
|
||||
PersistenceType& aPersistenceType) {
|
||||
static_assert(
|
||||
PERSISTENCE_TYPE_PERSISTENT == 0 && PERSISTENCE_TYPE_TEMPORARY == 1 &&
|
||||
PERSISTENCE_TYPE_DEFAULT == 2 && PERSISTENCE_TYPE_INVALID == 3,
|
||||
"Incorrect enum values!");
|
||||
|
||||
if (aInt < PERSISTENCE_TYPE_PERSISTENT || aInt > PERSISTENCE_TYPE_DEFAULT) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
aPersistenceType = static_cast<PersistenceType>(aInt);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
inline nsresult NullablePersistenceTypeFromText(
|
||||
const nsACString& aText, Nullable<PersistenceType>* aPersistenceType) {
|
||||
if (aText.IsVoid()) {
|
||||
*aPersistenceType = Nullable<PersistenceType>();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aText.EqualsLiteral("persistent")) {
|
||||
*aPersistenceType = Nullable<PersistenceType>(PERSISTENCE_TYPE_PERSISTENT);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aText.EqualsLiteral("temporary")) {
|
||||
*aPersistenceType = Nullable<PersistenceType>(PERSISTENCE_TYPE_TEMPORARY);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aText.EqualsLiteral("default")) {
|
||||
*aPersistenceType = Nullable<PersistenceType>(PERSISTENCE_TYPE_DEFAULT);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
inline mozilla::dom::StorageType PersistenceTypeToStorage(
|
||||
PersistenceType aPersistenceType) {
|
||||
return mozilla::dom::StorageType(static_cast<int>(aPersistenceType));
|
||||
}
|
||||
|
||||
inline PersistenceType PersistenceTypeFromStorage(
|
||||
const Optional<mozilla::dom::StorageType>& aStorage) {
|
||||
if (aStorage.WasPassed()) {
|
||||
return PersistenceType(static_cast<int>(aStorage.Value()));
|
||||
}
|
||||
|
||||
return PERSISTENCE_TYPE_DEFAULT;
|
||||
}
|
||||
|
||||
inline PersistenceType ComplementaryPersistenceType(
|
||||
const PersistenceType aPersistenceType) {
|
||||
PersistenceType aPersistenceType) {
|
||||
MOZ_ASSERT(aPersistenceType == PERSISTENCE_TYPE_DEFAULT ||
|
||||
aPersistenceType == PERSISTENCE_TYPE_TEMPORARY);
|
||||
|
||||
|
|
|
@ -78,16 +78,16 @@ nsresult GetClearResetOriginParams(nsIPrincipal* aPrincipal,
|
|||
return rv;
|
||||
}
|
||||
|
||||
if (aPersistenceType.IsVoid()) {
|
||||
Nullable<PersistenceType> persistenceType;
|
||||
rv = NullablePersistenceTypeFromText(aPersistenceType, &persistenceType);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
if (persistenceType.IsNull()) {
|
||||
aParams.persistenceTypeIsExplicit() = false;
|
||||
} else {
|
||||
const auto maybePersistenceType =
|
||||
PersistenceTypeFromString(aPersistenceType, fallible);
|
||||
if (NS_WARN_IF(maybePersistenceType.isNothing())) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
aParams.persistenceType() = maybePersistenceType.value();
|
||||
aParams.persistenceType() = persistenceType.Value();
|
||||
aParams.persistenceTypeIsExplicit() = true;
|
||||
}
|
||||
|
||||
|
@ -502,13 +502,13 @@ QuotaManagerService::InitStorageAndOrigin(nsIPrincipal* aPrincipal,
|
|||
return rv;
|
||||
}
|
||||
|
||||
const auto maybePersistenceType =
|
||||
PersistenceTypeFromString(aPersistenceType, fallible);
|
||||
if (NS_WARN_IF(maybePersistenceType.isNothing())) {
|
||||
Nullable<PersistenceType> persistenceType;
|
||||
rv = NullablePersistenceTypeFromText(aPersistenceType, &persistenceType);
|
||||
if (NS_WARN_IF(NS_FAILED(rv)) || persistenceType.IsNull()) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
params.persistenceType() = maybePersistenceType.value();
|
||||
params.persistenceType() = persistenceType.Value();
|
||||
|
||||
if (aClientType.IsVoid()) {
|
||||
params.clientTypeIsExplicit() = false;
|
||||
|
|
|
@ -68,7 +68,6 @@ UNIFIED_SOURCES += [
|
|||
'FileStreams.cpp',
|
||||
'MemoryOutputStream.cpp',
|
||||
'nsIndexedDBProtocolHandler.cpp',
|
||||
'PersistenceType.cpp',
|
||||
'QuotaCommon.cpp',
|
||||
'QuotaManagerService.cpp',
|
||||
'QuotaRequests.cpp',
|
||||
|
|
|
@ -227,21 +227,15 @@ SDBConnection::Init(nsIPrincipal* aPrincipal,
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
PersistenceType persistenceType;
|
||||
if (aPersistenceType.IsVoid()) {
|
||||
persistenceType = PERSISTENCE_TYPE_DEFAULT;
|
||||
} else {
|
||||
const auto maybePersistenceType =
|
||||
PersistenceTypeFromString(aPersistenceType, fallible);
|
||||
if (NS_WARN_IF(maybePersistenceType.isNothing())) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
persistenceType = maybePersistenceType.value();
|
||||
Nullable<PersistenceType> persistenceType;
|
||||
rv = NullablePersistenceTypeFromText(aPersistenceType, &persistenceType);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
mPrincipalInfo = std::move(principalInfo);
|
||||
mPersistenceType = persistenceType;
|
||||
mPersistenceType = persistenceType.IsNull() ? PERSISTENCE_TYPE_DEFAULT
|
||||
: persistenceType.Value();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче