mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 22:05:40 +00:00
Bug 793370 - crash in nsWebShellWindow::Initialize, r=smaug+bz
This commit is contained in:
parent
38529e6433
commit
a0d60e7f8f
@ -204,17 +204,18 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent,
|
|||||||
// top-level chrome window case. See bug 789773.
|
// top-level chrome window case. See bug 789773.
|
||||||
nsCOMPtr<nsIScriptSecurityManager> ssm =
|
nsCOMPtr<nsIScriptSecurityManager> ssm =
|
||||||
do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
|
do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
|
||||||
MOZ_ASSERT(NS_SUCCEEDED(rv) && ssm);
|
if (ssm) { // Sometimes this happens really early See bug 793370.
|
||||||
nsCOMPtr<nsIPrincipal> principal;
|
nsCOMPtr<nsIPrincipal> principal;
|
||||||
ssm->GetSubjectPrincipal(getter_AddRefs(principal));
|
ssm->GetSubjectPrincipal(getter_AddRefs(principal));
|
||||||
if (!principal) {
|
if (!principal) {
|
||||||
ssm->GetSystemPrincipal(getter_AddRefs(principal));
|
ssm->GetSystemPrincipal(getter_AddRefs(principal));
|
||||||
|
}
|
||||||
|
rv = mDocShell->CreateAboutBlankContentViewer(principal);
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
nsCOMPtr<nsIDocument> doc = do_GetInterface(mDocShell);
|
||||||
|
NS_ENSURE_TRUE(!!doc, NS_ERROR_FAILURE);
|
||||||
|
doc->SetIsInitialDocument(true);
|
||||||
}
|
}
|
||||||
rv = mDocShell->CreateAboutBlankContentViewer(principal);
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
|
||||||
nsCOMPtr<nsIDocument> doc = do_GetInterface(mDocShell);
|
|
||||||
NS_ENSURE_TRUE(!!doc, NS_ERROR_FAILURE);
|
|
||||||
doc->SetIsInitialDocument(true);
|
|
||||||
|
|
||||||
if (nullptr != aUrl) {
|
if (nullptr != aUrl) {
|
||||||
nsCString tmpStr;
|
nsCString tmpStr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user