From 0cb09645d3f6ef73a7e0dfa88794fcf4dbeb5c45 Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Wed, 26 Aug 2020 14:12:45 +0000 Subject: [PATCH] Bug 1536596 - Change AnonymizedOriginString and AnonymizedCString into functions. r=dom-workers-and-storage-reviewers,janv Differential Revision: https://phabricator.services.mozilla.com/D88288 --- dom/quota/QuotaCommon.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/dom/quota/QuotaCommon.h b/dom/quota/QuotaCommon.h index 4297dc86c7a3..22a2098f8322 100644 --- a/dom/quota/QuotaCommon.h +++ b/dom/quota/QuotaCommon.h @@ -513,22 +513,19 @@ LogModule* GetQuotaManagerLogger(); void AnonymizeCString(nsACString& aCString); -class AnonymizedCString : public nsCString { - public: - explicit AnonymizedCString(const nsACString& aCString) : nsCString(aCString) { - AnonymizeCString(*this); - } -}; +inline auto AnonymizedCString(const nsACString& aCString) { + nsAutoCString result{aCString}; + AnonymizeCString(result); + return result; +} void AnonymizeOriginString(nsACString& aOriginString); -class AnonymizedOriginString : public nsCString { - public: - explicit AnonymizedOriginString(const nsACString& aOriginString) - : nsCString(aOriginString) { - AnonymizeOriginString(*this); - } -}; +inline auto AnonymizedOriginString(const nsACString& aOriginString) { + nsAutoCString result{aOriginString}; + AnonymizeOriginString(result); + return result; +} template void StringifyTableKeys(const T& aTable, nsACString& aResult) {