mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1599569 - Make nsScriptSecurityManager::ClearJSCallbacks into a static method. r=kmag
XPConnect calls this method during shutdown after the pointer to the singleton nsScriptSecurityManager has been cleared, so it is actually calling it with a null |this|. Nobody noticed this because it isn't actually using |this|. This patch turns it into a static method to make the sanitizers happy. Differential Revision: https://phabricator.services.mozilla.com/D54846 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
32092a7398
commit
139398a824
@ -1389,6 +1389,7 @@ void nsScriptSecurityManager::InitJSCallbacks(JSContext* aCx) {
|
||||
JS_SetTrustedPrincipals(aCx, BasePrincipal::Cast(mSystemPrincipal));
|
||||
}
|
||||
|
||||
/* static */
|
||||
void nsScriptSecurityManager::ClearJSCallbacks(JSContext* aCx) {
|
||||
JS_SetSecurityCallbacks(aCx, nullptr);
|
||||
JS_SetTrustedPrincipals(aCx, nullptr);
|
||||
|
@ -52,7 +52,9 @@ class nsScriptSecurityManager final : public nsIScriptSecurityManager {
|
||||
static void InitStatics();
|
||||
|
||||
void InitJSCallbacks(JSContext* aCx);
|
||||
void ClearJSCallbacks(JSContext* aCx);
|
||||
|
||||
// This has to be static because it is called after gScriptSecMan is cleared.
|
||||
static void ClearJSCallbacks(JSContext* aCx);
|
||||
|
||||
static already_AddRefed<mozilla::SystemPrincipal>
|
||||
SystemPrincipalSingletonConstructor();
|
||||
|
@ -1121,7 +1121,7 @@ void XPCJSRuntime::Shutdown(JSContext* cx) {
|
||||
|
||||
JS::SetGCSliceCallback(cx, mPrevGCSliceCallback);
|
||||
|
||||
nsScriptSecurityManager::GetScriptSecurityManager()->ClearJSCallbacks(cx);
|
||||
nsScriptSecurityManager::ClearJSCallbacks(cx);
|
||||
|
||||
// Shut down the helper threads
|
||||
gHelperThreads->Shutdown();
|
||||
|
Loading…
Reference in New Issue
Block a user