diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /dom/quota/ScopedLogExtraInfo.cpp | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/quota/ScopedLogExtraInfo.cpp')
-rw-r--r-- | dom/quota/ScopedLogExtraInfo.cpp | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/dom/quota/ScopedLogExtraInfo.cpp b/dom/quota/ScopedLogExtraInfo.cpp index e9ddf84a8d..1c38c58f88 100644 --- a/dom/quota/ScopedLogExtraInfo.cpp +++ b/dom/quota/ScopedLogExtraInfo.cpp @@ -9,19 +9,27 @@ namespace mozilla::dom::quota { #ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED -MOZ_THREAD_LOCAL(const nsACString*) ScopedLogExtraInfo::sQueryValue; -MOZ_THREAD_LOCAL(const nsACString*) ScopedLogExtraInfo::sContextValue; +MOZ_THREAD_LOCAL(const Tainted<nsCString>*) +ScopedLogExtraInfo::sQueryValueTainted; +MOZ_THREAD_LOCAL(const Tainted<nsCString>*) +ScopedLogExtraInfo::sContextValueTainted; +MOZ_THREAD_LOCAL(const Tainted<nsCString>*) +ScopedLogExtraInfo::sStorageOriginValueTainted; /* static */ auto ScopedLogExtraInfo::FindSlot(const char* aTag) { // XXX For now, don't use a real map but just allow the known tag values. - if (aTag == kTagQuery) { - return &sQueryValue; + if (aTag == kTagQueryTainted) { + return &sQueryValueTainted; } - if (aTag == kTagContext) { - return &sContextValue; + if (aTag == kTagContextTainted) { + return &sContextValueTainted; + } + + if (aTag == kTagStorageOriginTainted) { + return &sStorageOriginValueTainted; } MOZ_CRASH("Unknown tag!"); @@ -51,20 +59,25 @@ ScopedLogExtraInfo::GetExtraInfoMap() { // the caller(s). ScopedLogExtraInfoMap map; - if (sQueryValue.get()) { - map.emplace(kTagQuery, sQueryValue.get()); + if (sQueryValueTainted.get()) { + map.emplace(kTagQueryTainted, sQueryValueTainted.get()); + } + + if (sContextValueTainted.get()) { + map.emplace(kTagContextTainted, sContextValueTainted.get()); } - if (sContextValue.get()) { - map.emplace(kTagContext, sContextValue.get()); + if (sStorageOriginValueTainted.get()) { + map.emplace(kTagStorageOriginTainted, sStorageOriginValueTainted.get()); } return map; } /* static */ void ScopedLogExtraInfo::Initialize() { - MOZ_ALWAYS_TRUE(sQueryValue.init()); - MOZ_ALWAYS_TRUE(sContextValue.init()); + MOZ_ALWAYS_TRUE(sQueryValueTainted.init()); + MOZ_ALWAYS_TRUE(sContextValueTainted.init()); + MOZ_ALWAYS_TRUE(sStorageOriginValueTainted.init()); } void ScopedLogExtraInfo::AddInfo() { |