Bug 1544127 - Make sure nsIPrincipal is only accessed on main thread, r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D135681
This commit is contained in:
Kershaw Chang 2022-01-19 13:52:05 +00:00
parent 655e5ff45c
commit e2611a28e9

View file

@ -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");