Bug 1769332 - Generate XPCOM error code lists for Java, r=geckoview-reviewers,agi,calu

This allows us to replace a number of magic numbers in the
WebRequestError code with automatically generated constants which are
guaranteed to be kept up to date.

This build script is able to run early enough during the build step as
generated files which take a `.jinja` file as an argument are hard-coded
to be run during the pre-export phase for Android builds. As it is just
as simple python script with no other dependencies, this shouldn't
impact geckoview build performance even when using build artifacts.

Differential Revision: https://phabricator.services.mozilla.com/D146356
This commit is contained in:
Nika Layzell
2022-05-16 18:01:19 +00:00
parent a011b84bbb
commit 36bc19406d
7 changed files with 109 additions and 36 deletions

View File

@@ -3879,10 +3879,10 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
}
if (nsCOMPtr<nsILoadURIDelegate> loadURIDelegate = GetLoadURIDelegate()) {
nsresult code = isHttpsOnlyError ? NS_ERROR_HTTPS_ONLY : aError;
nsCOMPtr<nsIURI> errorPageURI;
rv = loadURIDelegate->HandleLoadError(
aURI, (isHttpsOnlyError ? NS_ERROR_HTTPS_ONLY : aError),
NS_ERROR_GET_MODULE(aError), getter_AddRefs(errorPageURI));
rv = loadURIDelegate->HandleLoadError(aURI, code, NS_ERROR_GET_MODULE(code),
getter_AddRefs(errorPageURI));
// If the docshell is going away there's no point in showing an error page.
if (NS_FAILED(rv) || mIsBeingDestroyed) {
*aDisplayedErrorPage = false;