From e2611a28e95a099c262dfa73aa662bbde9cb540a Mon Sep 17 00:00:00 2001 From: Kershaw Chang Date: Wed, 19 Jan 2022 13:52:05 +0000 Subject: [PATCH] Bug 1544127 - Make sure nsIPrincipal is only accessed on main thread, r=necko-reviewers,valentin Differential Revision: https://phabricator.services.mozilla.com/D135681 --- caps/nsJSPrincipals.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/caps/nsJSPrincipals.cpp b/caps/nsJSPrincipals.cpp index b3199c480b29..a5d91708c1ed 100644 --- a/caps/nsJSPrincipals.cpp +++ b/caps/nsJSPrincipals.cpp @@ -27,7 +27,7 @@ using namespace mozilla::ipc; NS_IMETHODIMP_(MozExternalRefCountType) nsJSPrincipals::AddRef() { - MOZ_ASSERT(NS_IsMainThread()); + MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); MOZ_ASSERT(int32_t(refcount) >= 0, "illegal refcnt"); nsrefcnt count = ++refcount; NS_LOG_ADDREF(this, count, "nsJSPrincipals", sizeof(*this)); @@ -36,7 +36,7 @@ nsJSPrincipals::AddRef() { NS_IMETHODIMP_(MozExternalRefCountType) nsJSPrincipals::Release() { - MOZ_ASSERT(NS_IsMainThread()); + MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); MOZ_ASSERT(0 != refcount, "dup release"); nsrefcnt count = --refcount; NS_LOG_RELEASE(this, count, "nsJSPrincipals");