Skip to content
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: prefer to inherit observer classes privately #41360

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

ckerr
Copy link
Member

@ckerr ckerr commented Feb 16, 2024

Description of Change

We have a lot of classes that inherit from upstream FooObserver classes to manage some state, e.g. AutofillDriverFactory which inherits from content::WebContentsObserver so that it can know when to close popups by overriding DidFinishNavigation().

But since WebContentsObserver is 900+ lines long, that public inheritance means AutofillDriverFactory exposes a lot of public API to its clients. At best, it's just excess surface area. At worst, clients might accidentally use that API and cause a bug.

This PR tries to inherit from upstream FooObservers privately where possible.

Checklist

Release Notes

Notes: none.

@ckerr ckerr added semver/patch backwards-compatible bug fixes no-backport labels Feb 16, 2024
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Feb 16, 2024
@ckerr ckerr marked this pull request as draft February 16, 2024 21:21
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant