mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
bug 580128 - Set nsGlobalChromeWindows' principals to chrome even before they know it. r=jst
This commit is contained in:
parent
e9e8be9370
commit
da04c91998
@ -2460,11 +2460,18 @@ nsJSContext::CreateNativeGlobalForInner(
|
||||
nsIXPConnect *xpc = nsContentUtils::XPConnect();
|
||||
PRUint32 flags = aIsChrome? nsIXPConnect::FLAG_SYSTEM_GLOBAL_OBJECT : 0;
|
||||
nsCOMPtr<nsIXPConnectJSObjectHolder> jsholder;
|
||||
|
||||
nsCOMPtr<nsIPrincipal> systemPrincipal;
|
||||
if (aIsChrome) {
|
||||
nsIScriptSecurityManager *ssm = nsContentUtils::GetSecurityManager();
|
||||
ssm->GetSystemPrincipal(getter_AddRefs(systemPrincipal));
|
||||
}
|
||||
|
||||
nsresult rv = xpc->
|
||||
InitClassesWithNewWrappedGlobal(mContext,
|
||||
aNewInner, NS_GET_IID(nsISupports),
|
||||
aPrincipal, EmptyCString(),
|
||||
flags,
|
||||
aIsChrome ? systemPrincipal.get() : aPrincipal,
|
||||
EmptyCString(), flags,
|
||||
getter_AddRefs(jsholder));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
Loading…
Reference in New Issue
Block a user