Skip to content

Commit b805e93

Browse files
committed
Non generic CommandInfo
1 parent ca0572a commit b805e93

File tree

1 file changed

+4
-5
lines changed
  • dotnet/src/webdriver/BiDi/Communication

1 file changed

+4
-5
lines changed

dotnet/src/webdriver/BiDi/Communication/Broker.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public sealed class Broker : IAsyncDisposable
3737
private readonly BiDi _bidi;
3838
private readonly ITransport _transport;
3939

40-
private readonly ConcurrentDictionary<long, CommandInfo<EmptyResult>> _pendingCommands = new();
40+
private readonly ConcurrentDictionary<long, CommandInfo> _pendingCommands = new();
4141
private readonly BlockingCollection<(string Method, EventArgs Params)> _pendingEvents = [];
4242
private readonly Dictionary<string, JsonTypeInfo> _eventTypesMap = [];
4343

@@ -147,7 +147,7 @@ public async Task<TResult> ExecuteCommandAsync<TCommand, TResult>(TCommand comma
147147
var timeout = options?.Timeout ?? TimeSpan.FromSeconds(30);
148148
using var cts = new CancellationTokenSource(timeout);
149149
cts.Token.Register(() => tcs.TrySetCanceled(cts.Token));
150-
var commandInfo = new CommandInfo<EmptyResult>(command.Id, tcs, jsonResultTypeInfo);
150+
var commandInfo = new CommandInfo(command.Id, tcs, jsonResultTypeInfo);
151151
_pendingCommands[command.Id] = commandInfo;
152152
var data = JsonSerializer.SerializeToUtf8Bytes(command, jsonCommandTypeInfo);
153153

@@ -345,12 +345,11 @@ private void ProcessReceivedMessage(byte[]? data)
345345
}
346346
}
347347

348-
class CommandInfo<TResult>(long id, TaskCompletionSource<TResult> taskCompletionSource, JsonTypeInfo jsonResultTypeInfo)
349-
where TResult : EmptyResult
348+
class CommandInfo(long id, TaskCompletionSource<EmptyResult> taskCompletionSource, JsonTypeInfo jsonResultTypeInfo)
350349
{
351350
public long Id { get; } = id;
352351

353-
public TaskCompletionSource<TResult> TaskCompletionSource { get; } = taskCompletionSource;
352+
public TaskCompletionSource<EmptyResult> TaskCompletionSource { get; } = taskCompletionSource;
354353

355354
public JsonTypeInfo JsonResultTypeInfo { get; } = jsonResultTypeInfo;
356355
};

0 commit comments

Comments
 (0)