New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use upstream AutofillDriverFactory diffs #31676
refactor: use upstream AutofillDriverFactory diffs #31676
Conversation
Experimental PR related to upgrades. Specifically, #31555 includes https://chromium-review.googlesource.com/c/chromium/src/+/3241451 which removes the getAllFrames() API that our AutofillDriverFactory uses. Upstream had similar getAllFrames() calls and removed them in 2019 with https://chromium-review.googlesource.com/c/chromium/src/+/1826885 which lazy-creates the autofill drivers instead of doing it (indirectly) in the factory's constructor. This PR tries to do the same. This also changes the AutofillDriver class to remove its `receiver_` param; however, it was private and unused so it's possibly OK to remove. The changes here are wrapped in #ifdefs & have // TESTING markers since this is experimental to see if this plays nicely with CI autofill tests.
previously was done in AutofillDriver constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only changes from upstream are naming / namespaces to match Electron.
For example the edge case described & addressed in DriverForFrame() is copied from upstream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reuse //components/autofill
rather than maintaining a copy as follow-up ?
...maybe? Looking through the two codebases with that goal in mind, it's not clear to me how much work that would take. I will take that task on as a follow-up and merge this in the interim, since right now my main goal is to move the roll forward. |
No Release Notes |
* refactor: use upstream AutofillDriverFactory diffs Update our copy of AutofillDriver and AutofillDriverFactory to match chromium.
* refactor: use upstream AutofillDriverFactory diffs Update our copy of AutofillDriver and AutofillDriverFactory to match chromium.
Update our AutofillDriver and AutofillDriverFactory code to match upstream.
This was prompted by an upstream change that removes API that we were using. Specifically, #31555 includes https://chromium-review.googlesource.com/c/chromium/src/+/3241451 removes the getAllFrames() API that our AutofillDriverFactory uses.
Our code appears to be derived from components/autofill/content/browser/content_autfill_driver*[cc,h], whose identical use of getAllFrames() removed in 2019 by https://chromium-review.googlesource.com/c/chromium/src/+/1826885. In that change, the upstream factory was changed to create and bind the autofill drivers on command. This PR tries to follow that approach in our derived factory, copying the relevant upstream code from our current roll (97.0.4689.0).
This is a medium-sized refactor, so I've split it out into its own PR (a) to make CI / manual testing possible (since this isn't the only break in the Chromium roll) and (b) for easier code review.
Looks like these files haven't been changed in a substantial way in awhile, so CC'ing @brenca who did the last major work on them, but review welcome from anyone including @electron/wg-upgrades
Notes: none.