mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 603152 - Inner windows principals must remain constant. If we want to change them, change the inner window instead. r=bz
This commit is contained in:
parent
2ce9a1fca4
commit
b594d291ff
@ -852,6 +852,7 @@ NS_INTERFACE_MAP_BEGIN(nsDocShell)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebShellServices)
|
||||
NS_INTERFACE_MAP_ENTRY(nsILinkHandler)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIClipboardCommands)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDocShell_MOZILLA_2_0_BRANCH)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsDocLoader)
|
||||
|
||||
///*****************************************************************************
|
||||
@ -6463,6 +6464,12 @@ nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal* aPrincipal,
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal *aPrincipal)
|
||||
{
|
||||
return CreateAboutBlankContentViewer(aPrincipal, nsnull);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsDocShell::CanSavePresentation(PRUint32 aLoadType,
|
||||
nsIRequest *aNewRequest,
|
||||
|
@ -186,7 +186,8 @@ class nsDocShell : public nsDocLoader,
|
||||
public nsILoadContext,
|
||||
public nsIWebShellServices,
|
||||
public nsILinkHandler,
|
||||
public nsIClipboardCommands
|
||||
public nsIClipboardCommands,
|
||||
public nsIDocShell_MOZILLA_2_0_BRANCH
|
||||
{
|
||||
friend class nsDSURIContentListener;
|
||||
|
||||
@ -201,6 +202,7 @@ public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
NS_DECL_NSIDOCSHELL
|
||||
NS_DECL_NSIDOCSHELL_MOZILLA_2_0_BRANCH
|
||||
NS_DECL_NSIDOCSHELLTREEITEM
|
||||
NS_DECL_NSIDOCSHELLTREENODE
|
||||
NS_DECL_NSIDOCSHELLHISTORY
|
||||
|
@ -535,3 +535,12 @@ interface nsIDocShell : nsISupports
|
||||
*/
|
||||
readonly attribute unsigned long long historyID;
|
||||
};
|
||||
|
||||
[uuid(5f7a2184-31b6-4d67-9c75-0c17477766e2)]
|
||||
interface nsIDocShell_MOZILLA_2_0_BRANCH : nsISupports {
|
||||
/**
|
||||
* Create a new about:blank document and content viewer.
|
||||
* @param aPrincipal the principal to use for the new document.
|
||||
*/
|
||||
void createAboutBlankContentViewer(in nsIPrincipal aPrincipal);
|
||||
};
|
||||
|
@ -1469,7 +1469,7 @@ nsGlobalWindow::SetOpenerScriptPrincipal(nsIPrincipal* aPrincipal)
|
||||
// Do NOT set mOpenerScriptPrincipal in this case, just to be safe.
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
// We better have an about:blank document loaded at this point. Otherwise,
|
||||
// something is really weird.
|
||||
@ -1479,13 +1479,11 @@ nsGlobalWindow::SetOpenerScriptPrincipal(nsIPrincipal* aPrincipal)
|
||||
IsAboutBlank(mDoc->GetDocumentURI()),
|
||||
"Unexpected original document");
|
||||
#endif
|
||||
|
||||
// Set the opener principal on our document; given the above check, this
|
||||
// is safe.
|
||||
mDoc->SetPrincipal(aPrincipal);
|
||||
|
||||
nsCOMPtr<nsIDocShell_MOZILLA_2_0_BRANCH> ds(do_QueryInterface(GetDocShell()));
|
||||
ds->CreateAboutBlankContentViewer(aPrincipal);
|
||||
mDoc->SetIsInitialDocument(PR_TRUE);
|
||||
}
|
||||
|
||||
mOpenerScriptPrincipal = aPrincipal;
|
||||
}
|
||||
|
||||
nsIPrincipal*
|
||||
|
Loading…
Reference in New Issue
Block a user