Skip to content

Commit 12757f0

Browse files
authored
[dotnet] [bidi] Protect DTO types from inheritance (#15919)
1 parent 7e1e6f1 commit 12757f0

File tree

109 files changed

+365
-338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+365
-338
lines changed

dotnet/src/webdriver/BiDi/Browser/ClientWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
namespace OpenQA.Selenium.BiDi.Browser;
2121

22-
public record ClientWindow
22+
public sealed record ClientWindow
2323
{
2424
internal ClientWindow(string id)
2525
{

dotnet/src/webdriver/BiDi/Browser/ClientWindowInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
namespace OpenQA.Selenium.BiDi.Browser;
2121

22-
public record ClientWindowInfo(bool Active, ClientWindow ClientWindow, ClientWindowState State, int Height, int Width, int X, int Y);
22+
public sealed record ClientWindowInfo(bool Active, ClientWindow ClientWindow, ClientWindowState State, int Height, int Width, int X, int Y);
2323

2424
public enum ClientWindowState
2525
{

dotnet/src/webdriver/BiDi/Browser/CloseCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
namespace OpenQA.Selenium.BiDi.Browser;
2323

24-
internal class CloseCommand()
24+
internal sealed class CloseCommand()
2525
: Command<CommandParameters, EmptyResult>(CommandParameters.Empty, "browser.close");
2626

27-
public record CloseOptions : CommandOptions;
27+
public sealed class CloseOptions : CommandOptions;

dotnet/src/webdriver/BiDi/Browser/CreateUserContextCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121

2222
namespace OpenQA.Selenium.BiDi.Browser;
2323

24-
internal class CreateUserContextCommand(CreateUserContextCommandParameters @params)
24+
internal sealed class CreateUserContextCommand(CreateUserContextCommandParameters @params)
2525
: Command<CreateUserContextCommandParameters, UserContextInfo>(@params, "browser.createUserContext");
2626

27-
internal record CreateUserContextCommandParameters(bool? AcceptInsecureCerts, Session.ProxyConfiguration? Proxy) : CommandParameters;
27+
internal sealed record CreateUserContextCommandParameters(bool? AcceptInsecureCerts, Session.ProxyConfiguration? Proxy) : CommandParameters;
2828

29-
public record CreateUserContextOptions : CommandOptions
29+
public sealed class CreateUserContextOptions : CommandOptions
3030
{
3131
public bool? AcceptInsecureCerts { get; set; }
3232

dotnet/src/webdriver/BiDi/Browser/GetClientWindowsCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323

2424
namespace OpenQA.Selenium.BiDi.Browser;
2525

26-
internal class GetClientWindowsCommand()
26+
internal sealed class GetClientWindowsCommand()
2727
: Command<CommandParameters, GetClientWindowsResult>(CommandParameters.Empty, "browser.getClientWindows");
2828

29-
public record GetClientWindowsOptions : CommandOptions;
29+
public sealed class GetClientWindowsOptions : CommandOptions;
3030

31-
public record GetClientWindowsResult : EmptyResult, IReadOnlyList<ClientWindowInfo>
31+
public sealed record GetClientWindowsResult : EmptyResult, IReadOnlyList<ClientWindowInfo>
3232
{
3333
private readonly IReadOnlyList<ClientWindowInfo> _clientWindows;
3434

dotnet/src/webdriver/BiDi/Browser/GetUserContextsCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323

2424
namespace OpenQA.Selenium.BiDi.Browser;
2525

26-
internal class GetUserContextsCommand()
26+
internal sealed class GetUserContextsCommand()
2727
: Command<CommandParameters, GetUserContextsResult>(CommandParameters.Empty, "browser.getUserContexts");
2828

29-
public record GetUserContextsOptions : CommandOptions;
29+
public class GetUserContextsOptions : CommandOptions;
3030

31-
public record GetUserContextsResult : EmptyResult, IReadOnlyList<UserContextInfo>
31+
public sealed record GetUserContextsResult : EmptyResult, IReadOnlyList<UserContextInfo>
3232
{
3333
private readonly IReadOnlyList<UserContextInfo> _userContexts;
3434

dotnet/src/webdriver/BiDi/Browser/RemoveUserContextCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
namespace OpenQA.Selenium.BiDi.Browser;
2323

24-
internal class RemoveUserContextCommand(RemoveUserContextCommandParameters @params)
24+
internal sealed class RemoveUserContextCommand(RemoveUserContextCommandParameters @params)
2525
: Command<RemoveUserContextCommandParameters, EmptyResult>(@params, "browser.removeUserContext");
2626

27-
internal record RemoveUserContextCommandParameters(UserContext UserContext) : CommandParameters;
27+
internal sealed record RemoveUserContextCommandParameters(UserContext UserContext) : CommandParameters;
2828

29-
public record RemoveUserContextOptions : CommandOptions;
29+
public sealed class RemoveUserContextOptions : CommandOptions;

dotnet/src/webdriver/BiDi/Browser/UserContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
namespace OpenQA.Selenium.BiDi.Browser;
2424

25-
public class UserContext : IAsyncDisposable
25+
public sealed class UserContext : IAsyncDisposable
2626
{
2727
private readonly BiDi _bidi;
2828

dotnet/src/webdriver/BiDi/Browser/UserContextInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121

2222
namespace OpenQA.Selenium.BiDi.Browser;
2323

24-
public record UserContextInfo(UserContext UserContext) : EmptyResult;
24+
public sealed record UserContextInfo(UserContext UserContext) : EmptyResult;

dotnet/src/webdriver/BiDi/BrowsingContext/ActivateCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
namespace OpenQA.Selenium.BiDi.BrowsingContext;
2323

24-
internal class ActivateCommand(ActivateCommandParameters @params)
24+
internal sealed class ActivateCommand(ActivateCommandParameters @params)
2525
: Command<ActivateCommandParameters, EmptyResult>(@params, "browsingContext.activate");
2626

27-
internal record ActivateCommandParameters(BrowsingContext Context) : CommandParameters;
27+
internal sealed record ActivateCommandParameters(BrowsingContext Context) : CommandParameters;
2828

29-
public record ActivateOptions : CommandOptions;
29+
public sealed class ActivateOptions : CommandOptions;

0 commit comments

Comments
 (0)