Bug 1164292 - Properly implement nsExpandedPrincipal::GetOrigin. r=gabor

This commit is contained in:
Bobby Holley 2015-05-12 15:45:54 -07:00
parent 5bf76b579d
commit d664bc7478

View File

@ -774,7 +774,19 @@ nsExpandedPrincipal::SetDomain(nsIURI* aDomain)
NS_IMETHODIMP
nsExpandedPrincipal::GetOrigin(nsACString& aOrigin)
{
aOrigin.AssignLiteral(EXPANDED_PRINCIPAL_SPEC);
aOrigin.AssignLiteral("[Expanded Principal [");
for (size_t i = 0; i < mPrincipals.Length(); ++i) {
if (i != 0) {
aOrigin.AppendLiteral(", ");
}
nsAutoCString subOrigin;
nsresult rv = mPrincipals.ElementAt(i)->GetOrigin(subOrigin);
NS_ENSURE_SUCCESS(rv, rv);
aOrigin.Append(subOrigin);
}
aOrigin.Append("]]");
return NS_OK;
}