Bug 1580782 - Change Callsites to use nsIPrincipal->SchemeIs r=ckerschb

Differential Revision: https://phabricator.services.mozilla.com/D45654
This commit is contained in:
Sebastian Streich
2019-09-26 10:47:16 +00:00
parent 21651eaa36
commit 3d590ef9f8
13 changed files with 47 additions and 118 deletions

View File

@@ -776,15 +776,10 @@ nsresult HTMLFormElement::DoSecureToInsecureSubmitCheck(nsIURI* aActionURL,
*aCancelSubmit = true;
return NS_OK;
}
nsCOMPtr<nsIURI> principalURI;
nsresult rv = principal->GetURI(getter_AddRefs(principalURI));
if (NS_FAILED(rv)) {
return rv;
bool formIsHTTPS = principal->SchemeIs("https");
if (principal->IsSystemPrincipal() || principal->GetIsExpandedPrincipal()) {
formIsHTTPS = OwnerDoc()->GetDocumentURI()->SchemeIs("https");
}
if (!principalURI) {
principalURI = OwnerDoc()->GetDocumentURI();
}
bool formIsHTTPS = principalURI->SchemeIs("https");
if (!formIsHTTPS) {
return NS_OK;
}
@@ -819,7 +814,7 @@ nsresult HTMLFormElement::DoSecureToInsecureSubmitCheck(nsIURI* aActionURL,
if (!stringBundleService) {
return NS_ERROR_FAILURE;
}
rv = stringBundleService->CreateBundle(
nsresult rv = stringBundleService->CreateBundle(
"chrome://global/locale/browser.properties",
getter_AddRefs(stringBundle));
if (NS_FAILED(rv)) {