Skip to content

Commit

Permalink
chore: remove unused fields (microsoft#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Mar 1, 2021
1 parent f549d64 commit b19ae06
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
8 changes: 3 additions & 5 deletions src/PlaywrightSharp/Frame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,14 @@ namespace PlaywrightSharp
public class Frame : ChannelOwnerBase, IChannelOwner<Frame>, IFrame
{
private readonly FrameChannel _channel;
private readonly FrameInitializer _initializer;
private readonly List<LifecycleEvent> _loadStates = new List<LifecycleEvent>();

internal Frame(IChannelOwner parent, string guid, FrameInitializer initializer) : base(parent, guid)
{
_channel = new FrameChannel(guid, parent.Connection, this);
_initializer = initializer;
Url = _initializer.Url;
Name = _initializer.Name;
ParentFrame = _initializer.ParentFrame;
Url = initializer.Url;
Name = initializer.Name;
ParentFrame = initializer.ParentFrame;
_loadStates = initializer.LoadStates;

_channel.LoadState += (sender, e) =>
Expand Down
3 changes: 0 additions & 3 deletions src/PlaywrightSharp/Helpers/FlexibleStringEnumConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace PlaywrightSharp.Helpers
public class FlexibleStringEnumConverter<T> : JsonConverter<T>
{
private readonly Type _enumType = typeof(T);
private readonly Dictionary<int, EnumInfo> _rawToTransformed;
private readonly Dictionary<string, EnumInfo> _transformedToRaw;
private readonly T _default;

Expand All @@ -29,7 +28,6 @@ public FlexibleStringEnumConverter(T defaultValue)
string[] builtInNames = _enumType.GetEnumNames();
var builtInValues = _enumType.GetEnumValues();

_rawToTransformed = new Dictionary<int, EnumInfo>();
_transformedToRaw = new Dictionary<string, EnumInfo>();

for (int i = 0; i < builtInNames.Length; i++)
Expand All @@ -42,7 +40,6 @@ public FlexibleStringEnumConverter(T defaultValue)
var enumMemberAttribute = field.GetCustomAttribute<EnumMemberAttribute>(true);
string transformedName = enumMemberAttribute?.Value ?? name;

_rawToTransformed[rawValue] = new EnumInfo(transformedName, enumValue, rawValue);
_transformedToRaw[transformedName] = new EnumInfo(name, enumValue, rawValue);
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/PlaywrightSharp/JSHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ namespace PlaywrightSharp
public class JSHandle : ChannelOwnerBase, IChannelOwner<JSHandle>, IJSHandle
{
private readonly JSHandleChannel _channel;
private readonly JSHandleInitializer _initializer;

internal JSHandle(IChannelOwner parent, string guid, JSHandleInitializer initializer) : base(parent, guid)
{
_channel = new JSHandleChannel(guid, parent.Connection, this);
_initializer = initializer;
Preview = _initializer.Preview;
Preview = initializer.Preview;
}

/// <inheritdoc/>
Expand Down
4 changes: 1 addition & 3 deletions src/PlaywrightSharp/Transport/StdIOTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ internal class StdIOTransport : IConnectionTransport, IDisposable
{
private const int DefaultBufferSize = 1024; // Byte buffer size
private readonly Process _process;
private readonly ILoggerFactory _loggerFactory;
private readonly ILogger<StdIOTransport> _logger;
private readonly CancellationTokenSource _readerCancellationSource = new();
private readonly List<byte> _data = new();
Expand All @@ -20,8 +19,7 @@ internal class StdIOTransport : IConnectionTransport, IDisposable
internal StdIOTransport(Process process, ILoggerFactory loggerFactory, TransportTaskScheduler scheduler = null)
{
_process = process;
_loggerFactory = loggerFactory;
_logger = _loggerFactory?.CreateLogger<StdIOTransport>();
_logger = loggerFactory?.CreateLogger<StdIOTransport>();
scheduler ??= ScheduleTransportTask;
process.ErrorDataReceived += (s, e) => LogReceived?.Invoke(this, new LogReceivedEventArgs(e.Data));
process.BeginErrorReadLine();
Expand Down

0 comments on commit b19ae06

Please sign in to comment.