Bug 1238160 - Set tab context's isolation from frame attr. r=smaug

Renames existing nsFrameLoader::OwnerIsBrowser* methods to add "Moz" prefix for
clarity.

Adds nsFrameLoader::OwnerIsIsolatedMozBrowserFrame which checks the noisolation
attribute of mozbrowser frames, if present.

This is used to set isolation in nsFrameLoader::GetNewTabContext only when true.

MozReview-Commit-ID: Dz02xBoKh1P
This commit is contained in:
J. Ryan Stinnett
2016-02-17 21:31:29 -06:00
parent 43eb79b373
commit 1203389da5
12 changed files with 91 additions and 41 deletions

View File

@@ -550,6 +550,20 @@ nsGenericHTMLFrameElement::GetReallyIsWidget(bool *aOut)
return NS_OK;
}
/* [infallible] */ NS_IMETHODIMP
nsGenericHTMLFrameElement::GetIsolated(bool *aOut)
{
*aOut = true;
if (!nsContentUtils::IsSystemPrincipal(NodePrincipal())) {
return NS_OK;
}
// Isolation is only disabled if the attribute is present
*aOut = !HasAttr(kNameSpaceID_None, nsGkAtoms::noisolation);
return NS_OK;
}
/* [infallible] */ NS_IMETHODIMP
nsGenericHTMLFrameElement::GetIsExpectingSystemMessage(bool *aOut)
{
@@ -705,4 +719,3 @@ nsGenericHTMLFrameElement::SwapFrameLoaders(nsXULElement& aOtherOwner,
{
aError.Throw(NS_ERROR_NOT_IMPLEMENTED);
}