Bug 806127 - ThirdPartyUtil should not consider in-process <iframe mozbrowser/mozapp> to be third-party. r=bz

This commit is contained in:
Justin Lebar 2012-11-09 16:37:40 -08:00
parent de0e89fed5
commit aa329ec788

View File

@ -115,7 +115,9 @@ ThirdPartyUtil::IsThirdPartyWindow(nsIDOMWindow* aWindow,
nsCOMPtr<nsIDOMWindow> current = aWindow, parent; nsCOMPtr<nsIDOMWindow> current = aWindow, parent;
nsCOMPtr<nsIURI> parentURI; nsCOMPtr<nsIURI> parentURI;
do { do {
rv = current->GetParent(getter_AddRefs(parent)); // We use GetScriptableParent rather than GetParent because we consider
// <iframe mozbrowser/mozapp> to be a top-level frame.
rv = current->GetScriptableParent(getter_AddRefs(parent));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
if (SameCOMIdentity(parent, current)) { if (SameCOMIdentity(parent, current)) {
@ -210,7 +212,9 @@ ThirdPartyUtil::IsThirdPartyChannel(nsIChannel* aChannel,
ctx->GetAssociatedWindow(getter_AddRefs(ourWin)); ctx->GetAssociatedWindow(getter_AddRefs(ourWin));
if (!ourWin) return NS_ERROR_INVALID_ARG; if (!ourWin) return NS_ERROR_INVALID_ARG;
ourWin->GetParent(getter_AddRefs(parentWin)); // We use GetScriptableParent rather than GetParent because we consider
// <iframe mozbrowser/mozapp> to be a top-level frame.
ourWin->GetScriptableParent(getter_AddRefs(parentWin));
NS_ENSURE_TRUE(parentWin, NS_ERROR_INVALID_ARG); NS_ENSURE_TRUE(parentWin, NS_ERROR_INVALID_ARG);
// Check whether this is the document channel for this window (representing a // Check whether this is the document channel for this window (representing a