[dotnet] Hide unnecessary chromium public fields#17113
[dotnet] Hide unnecessary chromium public fields#17113nvborisenko wants to merge 1 commit intoSeleniumHQ:trunkfrom
Conversation
PR TypeEnhancement Description
File Walkthrough
|
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||
PR Code Suggestions ✨No code suggestions found for the PR. |
There was a problem hiding this comment.
Pull request overview
This PR reduces the public API surface of the .NET ChromiumDriver by changing several command-name/static fields from public to protected, limiting access to subclasses (e.g., ChromeDriver, EdgeDriver) rather than all consumers.
Changes:
- Changed multiple
ChromiumDriverstatic fields (command names andAcceptUntrustedCertificates) frompublictoprotected.
| protected static readonly bool AcceptUntrustedCertificates = true; | ||
|
|
||
| /// <summary> | ||
| /// Command for executing a Chrome DevTools Protocol command in a driver for a Chromium-based browser. | ||
| /// </summary> | ||
| public static readonly string ExecuteCdp = "executeCdpCommand"; | ||
| protected static readonly string ExecuteCdp = "executeCdpCommand"; |
There was a problem hiding this comment.
Changing these members from public to protected is a breaking source and binary API change (existing compiled consumers can start throwing MissingFieldException). Repo guidance calls out maintaining API/ABI compatibility and using a deprecation cycle before removing public functionality (see AGENTS.md:12 and AGENTS.md:65-67; dotnet/AGENTS.md:26-30). Consider keeping the public fields for now but marking them [Obsolete] (and optionally [EditorBrowsable(EditorBrowsableState.Never)]) so they’re hidden from IntelliSense, then remove in a later release.
This pull request makes a small but important change to the
ChromiumDriverclass by changing the visibility of several static fields frompublictoprotected. This limits their accessibility to the class itself and its subclasses, rather than exposing them publicly.publictoprotectedinChromiumDriver.cs:AcceptUntrustedCertificatesExecuteCdpGetCastSinksCommandSelectCastSinkCommandStartCastTabMirroringCommandStartCastDesktopMirroringCommandGetCastIssueMessageCommandStopCastingCommandGetNetworkConditionsCommandSetNetworkConditionsCommandDeleteNetworkConditionsCommandSendChromeCommandSendChromeCommandWithResultLaunchAppCommandSetPermissionCommand💡 Additional Considerations
Hopefully nobody even knows it exists. So just "remove".
🔄 Types of changes