Bug 1443925 - Part 3: Make nsScriptSecurityManager::GetStrictFileOriginPolicy threadsafe, r=ckerschb

This is used in various places in principals, as well as in the implementation
of nsScriptSecurityManager::SecurityCompareURIs which is also now threadsafe
after this change.

Differential Revision: https://phabricator.services.mozilla.com/D163033
This commit is contained in:
Nika Layzell 2022-12-02 00:53:50 +00:00
parent e2f6bee4ab
commit ee682d387a
2 changed files with 2 additions and 2 deletions

View file

@ -79,7 +79,7 @@ using namespace mozilla;
using namespace mozilla::dom;
nsIIOService* nsScriptSecurityManager::sIOService = nullptr;
bool nsScriptSecurityManager::sStrictFileOriginPolicy = true;
std::atomic<bool> nsScriptSecurityManager::sStrictFileOriginPolicy = true;
namespace {

View file

@ -134,7 +134,7 @@ class nsScriptSecurityManager final : public nsIScriptSecurityManager {
// policy machinery will be removed soon.
nsCOMPtr<nsIDomainPolicy> mDomainPolicy;
static bool sStrictFileOriginPolicy;
static std::atomic<bool> sStrictFileOriginPolicy;
static nsIIOService* sIOService;
static nsIStringBundle* sStrBundle;