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

Merged
merged 19 commits into from
May 21, 2024

Conversation

ckerr
Copy link
Member

@ckerr ckerr commented Feb 16, 2024

Description of Change

We have a lot of classes that inherit from upstream observer classes to manage internal state, e.g. our AutofillDriverFactory inherits from content::WebContentsObserver so that it can know when to close popups.

Since WebContentsObserver inherits AutofillDriverFactory publicly, we are accidentally exposing a lot of public API (it's a 900+ LOC class!) to WebContentsObserver's clients. We shouldn't do that; it might accidentally get used.

This PR uses private inheritance instead..

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
@ckerr ckerr force-pushed the refactor/prefer-to-inherit-observer-classes-privately branch from d801684 to 499c5f3 Compare May 9, 2024 02:39
@ckerr ckerr marked this pull request as ready for review May 10, 2024 14:54
@electron-cation electron-cation bot added new-pr 🌱 PR opened in the last 24 hours and removed new-pr 🌱 PR opened in the last 24 hours labels May 10, 2024
@ckerr ckerr requested a review from miniak May 15, 2024 22:03
@ckerr ckerr merged commit 752efdd into main May 21, 2024
21 checks passed
@ckerr ckerr deleted the refactor/prefer-to-inherit-observer-classes-privately branch May 21, 2024 19:21
Copy link

release-clerk bot commented May 21, 2024

No Release Notes

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

2 participants