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

--HG--
extra : rebase_source : e6142b0f71f6a6daf7740d694f0d4201cfba7642
This commit is contained in:
Justin Lebar 2012-10-30 15:55:05 -04:00
parent 65f06d5150
commit 43d4d8a8b6

View File

@ -115,7 +115,9 @@ ThirdPartyUtil::IsThirdPartyWindow(nsIDOMWindow* aWindow,
nsCOMPtr<nsIDOMWindow> current = aWindow, parent;
nsCOMPtr<nsIURI> parentURI;
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);
if (SameCOMIdentity(parent, current)) {
@ -210,7 +212,9 @@ ThirdPartyUtil::IsThirdPartyChannel(nsIChannel* aChannel,
ctx->GetAssociatedWindow(getter_AddRefs(ourWin));
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);
// Check whether this is the document channel for this window (representing a