Closed Bug 1769332 Opened 2 years ago Closed 2 years ago

Consider generating error code lists from ErrorList.py

Categories

(GeckoView :: General, enhancement)

Unspecified
All
enhancement

Tracking

(firefox-esr91 wontfix, firefox100 wontfix, firefox101 wontfix, firefox102 fixed)

RESOLVED FIXED
102 Branch
Tracking Status
firefox-esr91 --- wontfix
firefox100 --- wontfix
firefox101 --- wontfix
firefox102 --- fixed

People

(Reporter: nika, Assigned: nika)

Details

Attachments

(1 file)

Currently GeckoView has code which has hard-coded xpcom error code values for network request error handling. We should consider using ErrorList.py to generate a java file which defines these errors automatically for us.

We already generate some small amount of java code at build time (https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoChildProcessServices.jinja), so there is some support for generating java files using jinja early enough in the build process.

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.

Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c2f1f1735dbf
Generate XPCOM error code lists for Java, r=geckoview-reviewers,agi,calu
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch

No need to uplift to Beta 101.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: