Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
923f23f
[dotnet] Add trimming attributes, address some trim warnings
RenderMichael Oct 23, 2024
1b6adc1
Merge branch 'trunk' into trim-improvement
RenderMichael Oct 23, 2024
84714f3
Make DomainType struct readonly
RenderMichael Oct 23, 2024
5c2430a
Merge branch 'trim-improvement' of https://github.com/RenderMichael/s…
RenderMichael Oct 23, 2024
ec91f98
Merge branch 'trunk' into trim-improvement
RenderMichael Oct 28, 2024
b19ca4d
merge develop
RenderMichael Nov 17, 2024
59baae4
center preprocessor directives on .net 8+
RenderMichael Nov 17, 2024
b4564f9
Add file header to `TrimmingAttributes.cs`
RenderMichael Nov 17, 2024
a5c2e09
Tweak #if location
RenderMichael Nov 17, 2024
53e3d08
Merge branch 'trunk' into trim-improvement
RenderMichael Nov 17, 2024
26e327f
Hide `Assembly.CodeBase` from .NET 8 compilation
RenderMichael Nov 18, 2024
225a030
Remove changes from `DevToolsDomains`
RenderMichael Dec 8, 2024
1440e22
remove remaining changes from `DevToolsDomains`
RenderMichael Dec 8, 2024
310bdf8
Merge branch 'trunk' into trim-improvement
RenderMichael Dec 8, 2024
61a7f01
Merge branch 'trunk' into trim-improvement
RenderMichael Jan 25, 2025
6a6cd74
Merge branch 'trunk' into trim-improvement
RenderMichael Jan 31, 2025
ba85340
merge main
RenderMichael Jan 31, 2025
f1fce52
Annotate CDP as AOT-unsafe
RenderMichael Jan 31, 2025
1092962
Annotate CDP as fully AOT-unsafe
RenderMichael Jan 31, 2025
1a03caa
merge trunk
RenderMichael Feb 27, 2025
70489a6
merge trunk
RenderMichael Feb 28, 2025
68339cd
Improve AOT incompatibility message
RenderMichael Feb 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions dotnet/src/webdriver/DevTools/DevToolsSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using OpenQA.Selenium.Internal.Logging;
using System;
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Net.Http;
using System.Text.Json;
Expand Down Expand Up @@ -148,6 +149,8 @@ public T GetVersionSpecificDomains<T>() where T : DevToolsSessionDomains
/// <param name="millisecondsTimeout">The execution timeout of the command in milliseconds.</param>
/// <param name="throwExceptionIfResponseNotReceived"><see langword="true"/> to throw an exception if a response is not received; otherwise, <see langword="false"/>.</param>
/// <returns>The command response object implementing the <see cref="ICommandResponse{T}"/> interface.</returns>
[RequiresUnreferencedCode("SendCommand is not compatible with trimming or AOT. Use the overload that takes JsonNode parameters instead")]
[RequiresDynamicCode("SendCommand is not compatible with trimming or AOT. Use the overload that takes JsonNode parameters instead")]
public async Task<ICommandResponse<TCommand>> SendCommand<TCommand>(TCommand command, CancellationToken cancellationToken = default(CancellationToken), int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
where TCommand : ICommand
{
Expand Down Expand Up @@ -181,6 +184,8 @@ public T GetVersionSpecificDomains<T>() where T : DevToolsSessionDomains
/// <param name="millisecondsTimeout">The execution timeout of the command in milliseconds.</param>
/// <param name="throwExceptionIfResponseNotReceived"><see langword="true"/> to throw an exception if a response is not received; otherwise, <see langword="false"/>.</param>
/// <returns>The command response object implementing the <see cref="ICommandResponse{T}"/> interface.</returns>
[RequiresUnreferencedCode("SendCommand is not compatible with trimming or AOT. Use the overload that takes JsonNode parameters instead")]
[RequiresDynamicCode("SendCommand is not compatible with trimming or AOT. Use the overload that takes JsonNode parameters instead")]
public async Task<ICommandResponse<TCommand>> SendCommand<TCommand>(TCommand command, string sessionId, CancellationToken cancellationToken = default(CancellationToken), int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
where TCommand : ICommand
{
Expand Down Expand Up @@ -214,6 +219,8 @@ public T GetVersionSpecificDomains<T>() where T : DevToolsSessionDomains
/// <param name="millisecondsTimeout">The execution timeout of the command in milliseconds.</param>
/// <param name="throwExceptionIfResponseNotReceived"><see langword="true"/> to throw an exception if a response is not received; otherwise, <see langword="false"/>.</param>
/// <returns>The command response object implementing the <see cref="ICommandResponse{T}"/> interface.</returns>
[RequiresUnreferencedCode("SendCommand is not compatible with trimming or AOT. Use the overload that takes JsonNode parameters instead")]
[RequiresDynamicCode("SendCommand is not compatible with trimming or AOT. Use the overload that takes JsonNode parameters instead")]
public async Task<TCommandResponse> SendCommand<TCommand, TCommandResponse>(TCommand command, CancellationToken cancellationToken = default(CancellationToken), int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
where TCommand : ICommand
where TCommandResponse : ICommandResponse<TCommand>
Expand Down
5 changes: 5 additions & 0 deletions dotnet/src/webdriver/DevTools/IDevToolsSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// </copyright>

using System;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Threading;
Expand Down Expand Up @@ -59,6 +60,8 @@ public interface IDevToolsSession : IDisposable
/// <param name="millisecondsTimeout">The execution timeout of the command in milliseconds.</param>
/// <param name="throwExceptionIfResponseNotReceived"><see langword="true"/> to throw an exception if a response is not received; otherwise, <see langword="false"/>.</param>
/// <returns>The command response object implementing the <see cref="ICommandResponse{T}"/> interface.</returns>
[RequiresUnreferencedCode("SendCommand is not compatible with trimming or AOT. Use the overload that takes JsonNode parameters instead")]
[RequiresDynamicCode("SendCommand is not compatible with trimming or AOT. Use the overload that takes JsonNode parameters instead")]
Task<ICommandResponse<TCommand>> SendCommand<TCommand>(TCommand command, CancellationToken cancellationToken, int? millisecondsTimeout, bool throwExceptionIfResponseNotReceived)
where TCommand : ICommand;

Expand All @@ -72,6 +75,8 @@ Task<ICommandResponse<TCommand>> SendCommand<TCommand>(TCommand command, Cancell
/// <param name="millisecondsTimeout">The execution timeout of the command in milliseconds.</param>
/// <param name="throwExceptionIfResponseNotReceived"><see langword="true"/> to throw an exception if a response is not received; otherwise, <see langword="false"/>.</param>
/// <returns>The command response object implementing the <see cref="ICommandResponse{T}"/> interface.</returns>
[RequiresUnreferencedCode("SendCommand is not compatible with trimming or AOT. Use the overload that takes JsonNode parameters instead")]
[RequiresDynamicCode("SendCommand is not compatible with trimming or AOT. Use the overload that takes JsonNode parameters instead")]
Task<TCommandResponse> SendCommand<TCommand, TCommandResponse>(TCommand command, CancellationToken cancellationToken, int? millisecondsTimeout, bool throwExceptionIfResponseNotReceived)
where TCommand : ICommand
where TCommandResponse : ICommandResponse<TCommand>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.DevTools.Json
{
internal sealed class JsonEnumMemberConverter<TEnum> : JsonConverter<TEnum>
internal sealed class JsonEnumMemberConverter<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] TEnum> : JsonConverter<TEnum>
where TEnum : struct, Enum
{
private readonly Dictionary<TEnum, string> _enumToString = new Dictionary<TEnum, string>();
Expand Down
Loading
Loading