Path: blob/trunk/dotnet/src/webdriver/BiDi/Script/RealmInfoEventArgs.cs
8673 views
// <copyright file="RealmInfoEventArgs.cs" company="Selenium Committers"> // Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. // </copyright> using System.Text.Json.Serialization; using OpenQA.Selenium.BiDi.Json.Converters.Polymorphic; namespace OpenQA.Selenium.BiDi.Script; // https://github.com/dotnet/runtime/issues/72604 // [JsonPolymorphic(TypeDiscriminatorPropertyName = "type")] // [JsonDerivedType(typeof(WindowRealmInfoEventArgs), "window")] // [JsonDerivedType(typeof(DedicatedWorkerRealmInfoEventArgs), "dedicated-worker")] // [JsonDerivedType(typeof(SharedWorkerRealmInfoEventArgs), "shared-worker")] // [JsonDerivedType(typeof(ServiceWorkerRealmInfoEventArgs), "service-worker")] // [JsonDerivedType(typeof(WorkerRealmInfoEventArgs), "worker")] // [JsonDerivedType(typeof(PaintWorkletRealmInfoEventArgs), "paint-worklet")] // [JsonDerivedType(typeof(AudioWorkletRealmInfoEventArgs), "audio-worklet")] // [JsonDerivedType(typeof(WorkletRealmInfoEventArgs), "worklet")] [JsonConverter(typeof(RealmInfoEventArgsConverter))] public abstract record RealmInfoEventArgs(Realm Realm, string Origin) : EventArgs; public sealed record WindowRealmInfoEventArgs(Realm Realm, string Origin, BrowsingContext.BrowsingContext Context, Browser.UserContext? UserContext, string? Sandbox) : RealmInfoEventArgs(Realm, Origin); public sealed record DedicatedWorkerRealmInfoEventArgs(Realm Realm, string Origin, IReadOnlyList<Realm> Owners) : RealmInfoEventArgs(Realm, Origin); public sealed record SharedWorkerRealmInfoEventArgs(Realm Realm, string Origin) : RealmInfoEventArgs(Realm, Origin); public sealed record ServiceWorkerRealmInfoEventArgs(Realm Realm, string Origin) : RealmInfoEventArgs(Realm, Origin); public sealed record WorkerRealmInfoEventArgs(Realm Realm, string Origin) : RealmInfoEventArgs(Realm, Origin); public sealed record PaintWorkletRealmInfoEventArgs(Realm Realm, string Origin) : RealmInfoEventArgs(Realm, Origin); public sealed record AudioWorkletRealmInfoEventArgs(Realm Realm, string Origin) : RealmInfoEventArgs(Realm, Origin); public sealed record WorkletRealmInfoEventArgs(Realm Realm, string Origin) : RealmInfoEventArgs(Realm, Origin);