Bug 821809 - Part1: Assert for nsEP in DOMWindow. r=bholley
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -2184,16 +2184,21 @@ CreateNativeGlobalForInner(JSContext* aC
nsIPrincipal* aPrincipal,
JS::MutableHandle<JSObject*> aGlobal)
{
MOZ_ASSERT(aCx);
MOZ_ASSERT(aNewInner);
MOZ_ASSERT(aNewInner->IsInnerWindow());
MOZ_ASSERT(aPrincipal);
+ // DOMWindow with nsEP is not supported, we have to make sure
+ // no one creates one accidentally.
+ nsCOMPtr<nsIExpandedPrincipal> nsEP = do_QueryInterface(aPrincipal);
+ MOZ_RELEASE_ASSERT(!nsEP, "DOMWindow with nsEP is not supported");
+
nsGlobalWindow *top = nullptr;
if (aNewInner->GetOuterWindow()) {
top = aNewInner->GetTop();
}
JS::CompartmentOptions options;
if (top) {
if (top->GetGlobalJSObject()) {
options.setSameZoneAs(top->GetGlobalJSObject());