Skip to content
Permalink
Browse files

Bug 1132743 followup: hook up nsPrincipal.cpp's gCodeBasePrincipalSup…

…port in new InitializeStatics method, instead of lazily. implicit rs=dbaron
  • Loading branch information...
rmottola committed Aug 6, 2019
1 parent 6afd0dd commit 7223553f15a4e5052406bc29578506a60b138a15
Showing with 4 additions and 11 deletions.
  1. +4 −11 caps/nsPrincipal.cpp
@@ -34,9 +34,7 @@
using namespace mozilla;

static bool gIsWhitelistingTestDomains = false;
// XXXdholbert Add to InitializeStatics():
static bool gCodeBasePrincipalSupport = false;
static bool gIsObservingCodeBasePrincipalSupport = false;

static bool URIIsImmutable(nsIURI* aURI)
{
@@ -76,15 +74,6 @@ nsBasePrincipal::Release()

nsBasePrincipal::nsBasePrincipal()
{
if (!gIsObservingCodeBasePrincipalSupport) {
nsresult rv =
Preferences::AddBoolVarCache(&gCodeBasePrincipalSupport,
"signed.applets.codebase_principal_support",
false);
gIsObservingCodeBasePrincipalSupport = NS_SUCCEEDED(rv);
NS_WARN_IF_FALSE(gIsObservingCodeBasePrincipalSupport,
"Installing gCodeBasePrincipalSupport failed!");
}
}

nsBasePrincipal::~nsBasePrincipal(void)
@@ -137,6 +126,10 @@ nsPrincipal::InitializeStatics()
Preferences::AddBoolVarCache(
&gIsWhitelistingTestDomains,
"layout.css.unprefixing-service.include-test-domains");

Preferences::AddBoolVarCache(&gCodeBasePrincipalSupport,
"signed.applets.codebase_principal_support",
false);
}

nsPrincipal::nsPrincipal()

0 comments on commit 7223553

Please sign in to comment.
You can’t perform that action at this time.