Skip to content

Commit 33682e6

Browse files
committed
Move Network
1 parent e3b0903 commit 33682e6

File tree

2 files changed

+28
-23
lines changed

2 files changed

+28
-23
lines changed

dotnet/src/webdriver/BiDi/Communication/Json/BiDiJsonSerializerContext.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,27 +72,7 @@ namespace OpenQA.Selenium.BiDi.Communication.Json;
7272

7373

7474

75-
[JsonSerializable(typeof(Network.AddDataCollectorCommand))]
76-
[JsonSerializable(typeof(Network.AddDataCollectorResult))]
77-
[JsonSerializable(typeof(Network.AddInterceptCommand))]
78-
[JsonSerializable(typeof(Network.AddInterceptResult))]
79-
[JsonSerializable(typeof(Network.ContinueRequestCommand))]
80-
[JsonSerializable(typeof(Network.ContinueResponseCommand))]
81-
[JsonSerializable(typeof(Network.ContinueWithAuthCommand))]
82-
[JsonSerializable(typeof(Network.FailRequestCommand))]
83-
[JsonSerializable(typeof(Network.GetDataCommand))]
84-
[JsonSerializable(typeof(Network.GetDataResult))]
85-
[JsonSerializable(typeof(Network.ProvideResponseCommand))]
86-
[JsonSerializable(typeof(Network.RemoveDataCollectorCommand))]
87-
[JsonSerializable(typeof(Network.RemoveInterceptCommand))]
88-
[JsonSerializable(typeof(Network.SetCacheBehaviorCommand))]
89-
[JsonSerializable(typeof(Network.SetExtraHeadersCommand))]
9075

91-
[JsonSerializable(typeof(Network.BeforeRequestSentEventArgs))]
92-
[JsonSerializable(typeof(Network.ResponseStartedEventArgs))]
93-
[JsonSerializable(typeof(Network.ResponseCompletedEventArgs))]
94-
[JsonSerializable(typeof(Network.FetchErrorEventArgs))]
95-
[JsonSerializable(typeof(Network.AuthRequiredEventArgs))]
9676

9777
[JsonSerializable(typeof(Log.LogEntry))]
9878

dotnet/src/webdriver/BiDi/Network/NetworkModule.cs

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323
using System.Text.Json.Serialization;
2424
using System.Threading.Tasks;
2525
using OpenQA.Selenium.BiDi.Communication;
26-
using OpenQA.Selenium.BiDi.Communication.Json;
2726

2827
namespace OpenQA.Selenium.BiDi.Network;
2928

3029
public sealed partial class NetworkModule : Module
3130
{
32-
private JsonSerializerContext _jsonContext = null!;
31+
private NetworkModuleJsonSerializerContext _jsonContext = null!;
3332

3433
public async Task<Collector> AddDataCollectorAsync(IEnumerable<DataType> DataTypes, int MaxEncodedDataSize, AddDataCollectorOptions? options = null)
3534
{
@@ -181,6 +180,32 @@ public async Task<Subscription> OnAuthRequiredAsync(Action<AuthRequiredEventArgs
181180

182181
protected internal override void Initialize(JsonSerializerOptions options)
183182
{
184-
_jsonContext = new BiDiJsonSerializerContext(options);
183+
_jsonContext = new(options);
185184
}
186185
}
186+
187+
[JsonSerializable(typeof(Command))]
188+
[JsonSerializable(typeof(EmptyResult))]
189+
190+
[JsonSerializable(typeof(AddDataCollectorCommand))]
191+
[JsonSerializable(typeof(AddDataCollectorResult))]
192+
[JsonSerializable(typeof(AddInterceptCommand))]
193+
[JsonSerializable(typeof(AddInterceptResult))]
194+
[JsonSerializable(typeof(ContinueRequestCommand))]
195+
[JsonSerializable(typeof(ContinueResponseCommand))]
196+
[JsonSerializable(typeof(ContinueWithAuthCommand))]
197+
[JsonSerializable(typeof(FailRequestCommand))]
198+
[JsonSerializable(typeof(GetDataCommand))]
199+
[JsonSerializable(typeof(GetDataResult))]
200+
[JsonSerializable(typeof(ProvideResponseCommand))]
201+
[JsonSerializable(typeof(RemoveDataCollectorCommand))]
202+
[JsonSerializable(typeof(RemoveInterceptCommand))]
203+
[JsonSerializable(typeof(SetCacheBehaviorCommand))]
204+
[JsonSerializable(typeof(SetExtraHeadersCommand))]
205+
206+
[JsonSerializable(typeof(BeforeRequestSentEventArgs))]
207+
[JsonSerializable(typeof(ResponseStartedEventArgs))]
208+
[JsonSerializable(typeof(ResponseCompletedEventArgs))]
209+
[JsonSerializable(typeof(FetchErrorEventArgs))]
210+
[JsonSerializable(typeof(AuthRequiredEventArgs))]
211+
internal partial class NetworkModuleJsonSerializerContext : JsonSerializerContext;

0 commit comments

Comments
 (0)