зеркало из https://github.com/mozilla/pjs.git
bug 580128 - Set nsGlobalChromeWindows' principals to chrome even before they know it. r=jst
This commit is contained in:
Родитель
2a3b7cc2e2
Коммит
56e262cc3d
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче