Bug 1713820 - Rename QM_ENABLE_SCOPED_LOG_EXTRA_INFO to QM_SCOPED_LOG_EXTRA_INFO_ENABLED; r=dom-storage-reviewers,jstutte

Differential Revision: https://phabricator.services.mozilla.com/D117135
This commit is contained in:
Jan Varga 2021-06-08 16:27:30 +00:00
Родитель b55c49563c
Коммит daa6cfff06
5 изменённых файлов: 11 добавлений и 11 удалений

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

@ -2638,7 +2638,7 @@ void InitializeQuotaManager() {
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!gQuotaManagerInitialized);
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
ScopedLogExtraInfo::Initialize();
#endif

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

@ -16,7 +16,7 @@
#endif
#if defined(EARLY_BETA_OR_EARLIER) || defined(DEBUG)
# define QM_ENABLE_SCOPED_LOG_EXTRA_INFO
# define QM_SCOPED_LOG_EXTRA_INFO_ENABLED
#endif
#endif // DOM_QUOTA_CONFIG_H_

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

@ -241,7 +241,7 @@ template Result<SingleStepSuccessType<SingleStepResult::ReturnNullIfNoResult>,
CreateAndExecuteSingleStepStatement<SingleStepResult::ReturnNullIfNoResult>(
mozIStorageConnection& aConnection, const nsACString& aStatementString);
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
MOZ_THREAD_LOCAL(const nsACString*) ScopedLogExtraInfo::sQueryValue;
MOZ_THREAD_LOCAL(const nsACString*) ScopedLogExtraInfo::sContextValue;
@ -508,7 +508,7 @@ void LogError(const nsACString& aExpr, const Maybe<nsresult> aMaybeRv,
MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Bad severity value!");
}();
# ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
# ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
const auto& extraInfos = ScopedLogExtraInfo::GetExtraInfoMap();
for (const auto& item : extraInfos) {
extraInfosString.Append(", "_ns + nsDependentCString(item.first) + " "_ns +
@ -544,7 +544,7 @@ void LogError(const nsACString& aExpr, const Maybe<nsresult> aMaybeRv,
console->LogStringMessage(message.get());
}
# ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
# ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
if (const auto contextIt = extraInfos.find(ScopedLogExtraInfo::kTagContext);
contextIt != extraInfos.cend()) {
// For now, we don't include aExpr in the telemetry event. It might help to

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

@ -1345,7 +1345,7 @@ struct MOZ_STACK_CLASS ScopedLogExtraInfo {
static constexpr const char kTagQuery[] = "query";
static constexpr const char kTagContext[] = "context";
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
private:
static auto FindSlot(const char* aTag);

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

@ -1824,14 +1824,14 @@ TEST(QuotaCommon_ScopedLogExtraInfo, AddAndRemove)
const auto extraInfo =
ScopedLogExtraInfo{ScopedLogExtraInfo::kTagQuery, text};
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
EXPECT_EQ(text, *extraInfoMap.at(ScopedLogExtraInfo::kTagQuery));
#endif
}
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
EXPECT_EQ(0u, extraInfoMap.count(ScopedLogExtraInfo::kTagQuery));
@ -1851,19 +1851,19 @@ TEST(QuotaCommon_ScopedLogExtraInfo, Nested)
const auto extraInfo =
ScopedLogExtraInfo{ScopedLogExtraInfo::kTagQuery, nestedText};
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
EXPECT_EQ(nestedText, *extraInfoMap.at(ScopedLogExtraInfo::kTagQuery));
#endif
}
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
EXPECT_EQ(text, *extraInfoMap.at(ScopedLogExtraInfo::kTagQuery));
#endif
}
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
EXPECT_EQ(0u, extraInfoMap.count(ScopedLogExtraInfo::kTagQuery));