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
Родитель e2f6bee4ab
Коммит ee682d387a
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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 {

Просмотреть файл

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