diff options
author | Larry Ewing <lewing@microsoft.com> | 2020-01-28 06:38:35 +0300 |
---|---|---|
committer | Larry Ewing <lewing@microsoft.com> | 2020-01-29 03:53:27 +0300 |
commit | a6ebd5cb38cef4edea03fe51b03e4cb2364d568d (patch) | |
tree | ec3037aedc819f6aa2940fe39a0662f0d2bb4937 | |
parent | 4b620fa84dbff08bb655c6e04516488a9f16d987 (diff) |
Rename Ws* to something more reasonable
-rw-r--r-- | sdks/wasm/DebuggerTestSuite/Support.cs | 4 | ||||
-rw-r--r-- | sdks/wasm/DebuggerTestSuite/Tests.cs | 2 | ||||
-rw-r--r-- | sdks/wasm/Mono.WebAssembly.DebuggerProxy/DebugStore.cs | 2 | ||||
-rw-r--r-- | sdks/wasm/Mono.WebAssembly.DebuggerProxy/DevToolsClient.cs (renamed from sdks/wasm/Mono.WebAssembly.DebuggerProxy/WsClient.cs) | 11 | ||||
-rw-r--r-- | sdks/wasm/Mono.WebAssembly.DebuggerProxy/DevToolsProxy.cs (renamed from sdks/wasm/Mono.WebAssembly.DebuggerProxy/WsProxy.cs) | 20 | ||||
-rw-r--r-- | sdks/wasm/Mono.WebAssembly.DebuggerProxy/InspectorClient.cs | 6 | ||||
-rw-r--r-- | sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs | 4 | ||||
-rw-r--r-- | sdks/wasm/ProxyDriver/Program.cs | 2 | ||||
-rw-r--r-- | sdks/wasm/ProxyDriver/Startup.cs | 2 | ||||
-rw-r--r-- | sdks/wasm/ProxyDriver/TestHarnessStartup.cs | 5 |
10 files changed, 27 insertions, 31 deletions
diff --git a/sdks/wasm/DebuggerTestSuite/Support.cs b/sdks/wasm/DebuggerTestSuite/Support.cs index 106fbe85d72..8c5a251eaa4 100644 --- a/sdks/wasm/DebuggerTestSuite/Support.cs +++ b/sdks/wasm/DebuggerTestSuite/Support.cs @@ -8,7 +8,7 @@ using System.IO; using System.Text; using System.Collections.Generic; -using WsProxy; +using WebAssembly.Net.Debugging; using Newtonsoft.Json.Linq; using Xunit; @@ -133,7 +133,7 @@ namespace DebuggerTests } public DebuggerTestBase (string driver = "debugger-driver.html") { - startTask = WsProxy.TestHarnessProxy.Start (FindChromePath (), FindTestPath (), driver); + startTask = TestHarnessProxy.Start (FindChromePath (), FindTestPath (), driver); } public Task Ready () diff --git a/sdks/wasm/DebuggerTestSuite/Tests.cs b/sdks/wasm/DebuggerTestSuite/Tests.cs index d21ac9ee302..c432806ae11 100644 --- a/sdks/wasm/DebuggerTestSuite/Tests.cs +++ b/sdks/wasm/DebuggerTestSuite/Tests.cs @@ -10,7 +10,7 @@ using System.Collections.Generic; using Newtonsoft.Json.Linq; using Xunit; -using WsProxy; +using WebAssembly.Net.Debugging; namespace DebuggerTests { diff --git a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/DebugStore.cs b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/DebugStore.cs index 6ae478e7bf6..c8494518ad7 100644 --- a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/DebugStore.cs +++ b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/DebugStore.cs @@ -11,7 +11,7 @@ using Newtonsoft.Json; using System.Text.RegularExpressions; using System.Threading.Tasks; -namespace WsProxy { +namespace WebAssembly.Net.Debugging { internal class BreakPointRequest { public string Assembly { get; private set; } public string File { get; private set; } diff --git a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/WsClient.cs b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/DevToolsClient.cs index 26f73068e4b..2a2bda65c4c 100644 --- a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/WsClient.cs +++ b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/DevToolsClient.cs @@ -1,7 +1,5 @@ using System; -using System.Linq; using System.Threading.Tasks; -using Newtonsoft.Json.Linq; using System.Net.WebSockets; using System.Threading; @@ -9,18 +7,18 @@ using System.IO; using System.Text; using System.Collections.Generic; -namespace WsProxy { - public class WsClient: IDisposable { +namespace WebAssembly.Net.Debugging { + public class DevToolsClient: IDisposable { ClientWebSocket socket; List<Task> pending_ops = new List<Task> (); TaskCompletionSource<bool> side_exit = new TaskCompletionSource<bool> (); List<byte []> pending_writes = new List<byte []> (); Task current_write; - public WsClient () { + public DevToolsClient () { } - ~WsClient() { + ~DevToolsClient() { Dispose(false); } @@ -28,7 +26,6 @@ namespace WsProxy { Dispose(true); } - public async Task Close (CancellationToken cancellationToken) { if (socket.State == WebSocketState.Open) diff --git a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/WsProxy.cs b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/DevToolsProxy.cs index 9fea714fbe2..3b244ba58d5 100644 --- a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/WsProxy.cs +++ b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/DevToolsProxy.cs @@ -9,7 +9,7 @@ using System.IO; using System.Text; using System.Collections.Generic; -namespace WsProxy { +namespace WebAssembly.Net.Debugging { public class SessionId { public string sessionId; } @@ -65,13 +65,13 @@ namespace WsProxy { } } - class WsQueue { + class DevToolsQueue { Task current_send; List<byte []> pending; public WebSocket Ws { get; private set; } public Task CurrentSend { get { return current_send; } } - public WsQueue (WebSocket sock) + public DevToolsQueue (WebSocket sock) { this.Ws = sock; pending = new List<byte []> (); @@ -106,7 +106,7 @@ namespace WsProxy { } } - public class WsProxy { + public class DevToolsProxy { TaskCompletionSource<bool> side_exception = new TaskCompletionSource<bool> (); TaskCompletionSource<bool> client_initiated_close = new TaskCompletionSource<bool> (); List<(MessageId, TaskCompletionSource<Result>)> pending_cmds = new List<(MessageId, TaskCompletionSource<Result>)> (); @@ -114,7 +114,7 @@ namespace WsProxy { WebSocket ide; int next_cmd_id; List<Task> pending_ops = new List<Task> (); - List<WsQueue> queues = new List<WsQueue> (); + List<DevToolsQueue> queues = new List<DevToolsQueue> (); protected virtual Task<bool> AcceptEvent (SessionId sessionId, string method, JObject args, CancellationToken token) { @@ -153,12 +153,12 @@ namespace WsProxy { } } - WsQueue GetQueueForSocket (WebSocket ws) + DevToolsQueue GetQueueForSocket (WebSocket ws) { return queues.FirstOrDefault (q => q.Ws == ws); } - WsQueue GetQueueForTask (Task task) { + DevToolsQueue GetQueueForTask (Task task) { return queues.FirstOrDefault (q => q.CurrentSend == task); } @@ -180,7 +180,7 @@ namespace WsProxy { try { if (!await AcceptEvent (sessionId, method, args, token)) { //Console.WriteLine ("proxy browser: {0}::{1}",method, args); - SendEvent (sessionId, method, args, token); + SendEventInternal (sessionId, method, args, token); } } catch (Exception e) { side_exception.TrySetException (e); @@ -292,11 +292,11 @@ namespace WsProxy { Debug ($"WsProxy Starting on {browserUri}"); using (this.ide = ideSocket) { Debug ($"WsProxy: IDE waiting for connection on {browserUri}"); - queues.Add (new WsQueue (this.ide)); + queues.Add (new DevToolsQueue (this.ide)); using (this.browser = new ClientWebSocket ()) { this.browser.Options.KeepAliveInterval = Timeout.InfiniteTimeSpan; await this.browser.ConnectAsync (browserUri, CancellationToken.None); - queues.Add (new WsQueue (this.browser)); + queues.Add (new DevToolsQueue (this.browser)); Debug ($"WsProxy: Client connected on {browserUri}"); var x = new CancellationTokenSource (); diff --git a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/InspectorClient.cs b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/InspectorClient.cs index 1eecc2c6945..7454aa6d871 100644 --- a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/InspectorClient.cs +++ b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/InspectorClient.cs @@ -9,8 +9,8 @@ using System.IO; using System.Text; using System.Collections.Generic; -namespace WsProxy { - public class InspectorClient : WsClient { +namespace WebAssembly.Net.Debugging { + public class InspectorClient : DevToolsClient { List<(int, TaskCompletionSource<Result>)> pending_cmds = new List<(int, TaskCompletionSource<Result>)> (); Func<string, JObject, CancellationToken, Task> onEvent; int next_cmd_id; @@ -59,7 +59,7 @@ namespace WsProxy { pending_cmds.Add ((id, tcs)); var str = o.ToString (); - System.Console.WriteLine ($"Command: id: {id} method: {method} params: {args}"); + //Log ("protocol", $"SendCommand: id: {id} method: {method} params: {args}"); var bytes = Encoding.UTF8.GetBytes (str); Send (bytes, token); diff --git a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs index 5c88e1573cb..f7e25dfc546 100644 --- a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs +++ b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs @@ -8,7 +8,7 @@ using System.IO; using System.Collections.Generic; using System.Net; -namespace WsProxy { +namespace WebAssembly.Net.Debugging { internal class MonoCommands { public const string GET_CALL_STACK = "MONO.mono_wasm_get_call_stack()"; @@ -71,7 +71,7 @@ namespace WsProxy { Over } - public class MonoProxy : WsProxy { + public class MonoProxy : DevToolsProxy { DebugStore store; List<Breakpoint> breakpoints = new List<Breakpoint> (); List<Frame> current_callstack; diff --git a/sdks/wasm/ProxyDriver/Program.cs b/sdks/wasm/ProxyDriver/Program.cs index 9224670ee5c..9a564382d79 100644 --- a/sdks/wasm/ProxyDriver/Program.cs +++ b/sdks/wasm/ProxyDriver/Program.cs @@ -7,7 +7,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; -namespace WsProxy +namespace WebAssembly.Net.Debugging { public class ProxyOptions { public Uri DevToolsUrl { get; set; } = new Uri ("http://localhost:9222"); diff --git a/sdks/wasm/ProxyDriver/Startup.cs b/sdks/wasm/ProxyDriver/Startup.cs index 60fde1457eb..61a18b561b3 100644 --- a/sdks/wasm/ProxyDriver/Startup.cs +++ b/sdks/wasm/ProxyDriver/Startup.cs @@ -12,7 +12,7 @@ using System.Collections.Generic; using Newtonsoft.Json; using System.Linq; -namespace WsProxy { +namespace WebAssembly.Net.Debugging { internal class Startup { // This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 diff --git a/sdks/wasm/ProxyDriver/TestHarnessStartup.cs b/sdks/wasm/ProxyDriver/TestHarnessStartup.cs index 9b91dbc7bf6..8434f2308f3 100644 --- a/sdks/wasm/ProxyDriver/TestHarnessStartup.cs +++ b/sdks/wasm/ProxyDriver/TestHarnessStartup.cs @@ -14,10 +14,8 @@ using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Options; using Microsoft.AspNetCore.StaticFiles; using Newtonsoft.Json.Linq; -using WsProxy; - -namespace WsProxy { +namespace WebAssembly.Net.Debugging { public class TestHarnessStartup { public TestHarnessStartup (IConfiguration configuration) { @@ -119,6 +117,7 @@ namespace WsProxy { proc.Close (); } } + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure (IApplicationBuilder app, IOptionsMonitor<TestHarnessOptions> optionsAccessor, IWebHostEnvironment env) { |