Bug 1443925 - Part 5: Make it possible to get the system principal from any thread, r=ckerschb
This is required because the script security manager which currently owns the singleton is main-thread only. This change still ties the lifecycle of the static to that service, but also makes it generally available from any thread. Differential Revision: https://phabricator.services.mozilla.com/D163035
This commit is contained in:
@@ -1554,9 +1554,7 @@ nsresult nsScriptSecurityManager::Init() {
|
||||
InitPrefs();
|
||||
|
||||
// Create our system principal singleton
|
||||
RefPtr<SystemPrincipal> system = SystemPrincipal::Create();
|
||||
|
||||
mSystemPrincipal = system;
|
||||
mSystemPrincipal = SystemPrincipal::Init();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -1600,6 +1598,7 @@ nsScriptSecurityManager::~nsScriptSecurityManager(void) {
|
||||
void nsScriptSecurityManager::Shutdown() {
|
||||
NS_IF_RELEASE(sIOService);
|
||||
BundleHelper::Shutdown();
|
||||
SystemPrincipal::Shutdown();
|
||||
}
|
||||
|
||||
nsScriptSecurityManager* nsScriptSecurityManager::GetScriptSecurityManager() {
|
||||
|
||||
Reference in New Issue
Block a user