зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
b55c49563c
Коммит
daa6cfff06
|
@ -2638,7 +2638,7 @@ void InitializeQuotaManager() {
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(!gQuotaManagerInitialized);
|
MOZ_ASSERT(!gQuotaManagerInitialized);
|
||||||
|
|
||||||
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
|
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
|
||||||
ScopedLogExtraInfo::Initialize();
|
ScopedLogExtraInfo::Initialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(EARLY_BETA_OR_EARLIER) || defined(DEBUG)
|
#if defined(EARLY_BETA_OR_EARLIER) || defined(DEBUG)
|
||||||
# define QM_ENABLE_SCOPED_LOG_EXTRA_INFO
|
# define QM_SCOPED_LOG_EXTRA_INFO_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // DOM_QUOTA_CONFIG_H_
|
#endif // DOM_QUOTA_CONFIG_H_
|
||||||
|
|
|
@ -241,7 +241,7 @@ template Result<SingleStepSuccessType<SingleStepResult::ReturnNullIfNoResult>,
|
||||||
CreateAndExecuteSingleStepStatement<SingleStepResult::ReturnNullIfNoResult>(
|
CreateAndExecuteSingleStepStatement<SingleStepResult::ReturnNullIfNoResult>(
|
||||||
mozIStorageConnection& aConnection, const nsACString& aStatementString);
|
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::sQueryValue;
|
||||||
MOZ_THREAD_LOCAL(const nsACString*) ScopedLogExtraInfo::sContextValue;
|
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!");
|
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();
|
const auto& extraInfos = ScopedLogExtraInfo::GetExtraInfoMap();
|
||||||
for (const auto& item : extraInfos) {
|
for (const auto& item : extraInfos) {
|
||||||
extraInfosString.Append(", "_ns + nsDependentCString(item.first) + " "_ns +
|
extraInfosString.Append(", "_ns + nsDependentCString(item.first) + " "_ns +
|
||||||
|
@ -544,7 +544,7 @@ void LogError(const nsACString& aExpr, const Maybe<nsresult> aMaybeRv,
|
||||||
console->LogStringMessage(message.get());
|
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);
|
if (const auto contextIt = extraInfos.find(ScopedLogExtraInfo::kTagContext);
|
||||||
contextIt != extraInfos.cend()) {
|
contextIt != extraInfos.cend()) {
|
||||||
// For now, we don't include aExpr in the telemetry event. It might help to
|
// 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 kTagQuery[] = "query";
|
||||||
static constexpr const char kTagContext[] = "context";
|
static constexpr const char kTagContext[] = "context";
|
||||||
|
|
||||||
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
|
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
|
||||||
private:
|
private:
|
||||||
static auto FindSlot(const char* aTag);
|
static auto FindSlot(const char* aTag);
|
||||||
|
|
||||||
|
|
|
@ -1824,14 +1824,14 @@ TEST(QuotaCommon_ScopedLogExtraInfo, AddAndRemove)
|
||||||
const auto extraInfo =
|
const auto extraInfo =
|
||||||
ScopedLogExtraInfo{ScopedLogExtraInfo::kTagQuery, text};
|
ScopedLogExtraInfo{ScopedLogExtraInfo::kTagQuery, text};
|
||||||
|
|
||||||
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
|
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
|
||||||
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
|
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
|
||||||
|
|
||||||
EXPECT_EQ(text, *extraInfoMap.at(ScopedLogExtraInfo::kTagQuery));
|
EXPECT_EQ(text, *extraInfoMap.at(ScopedLogExtraInfo::kTagQuery));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
|
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
|
||||||
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
|
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
|
||||||
|
|
||||||
EXPECT_EQ(0u, extraInfoMap.count(ScopedLogExtraInfo::kTagQuery));
|
EXPECT_EQ(0u, extraInfoMap.count(ScopedLogExtraInfo::kTagQuery));
|
||||||
|
@ -1851,19 +1851,19 @@ TEST(QuotaCommon_ScopedLogExtraInfo, Nested)
|
||||||
const auto extraInfo =
|
const auto extraInfo =
|
||||||
ScopedLogExtraInfo{ScopedLogExtraInfo::kTagQuery, nestedText};
|
ScopedLogExtraInfo{ScopedLogExtraInfo::kTagQuery, nestedText};
|
||||||
|
|
||||||
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
|
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
|
||||||
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
|
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
|
||||||
EXPECT_EQ(nestedText, *extraInfoMap.at(ScopedLogExtraInfo::kTagQuery));
|
EXPECT_EQ(nestedText, *extraInfoMap.at(ScopedLogExtraInfo::kTagQuery));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
|
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
|
||||||
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
|
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
|
||||||
EXPECT_EQ(text, *extraInfoMap.at(ScopedLogExtraInfo::kTagQuery));
|
EXPECT_EQ(text, *extraInfoMap.at(ScopedLogExtraInfo::kTagQuery));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QM_ENABLE_SCOPED_LOG_EXTRA_INFO
|
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
|
||||||
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
|
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
|
||||||
|
|
||||||
EXPECT_EQ(0u, extraInfoMap.count(ScopedLogExtraInfo::kTagQuery));
|
EXPECT_EQ(0u, extraInfoMap.count(ScopedLogExtraInfo::kTagQuery));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче