renamed the Socket class to MessageDispatcher
diff --git a/weinre.web/demo/weinre-demo-pieces.html b/weinre.web/demo/weinre-demo-pieces.html
index 3b75e09..b9d05ee 100644
--- a/weinre.web/demo/weinre-demo-pieces.html
+++ b/weinre.web/demo/weinre-demo-pieces.html
@@ -15,7 +15,7 @@
<script src="/weinre/common/StackTrace.transportd.js"></script>
<script src="/weinre/common/Weinre.transportd.js"></script>
<script src="/weinre/common/IDLTools.transportd.js"></script>
-<script src="/weinre/common/Socket.transportd.js"></script>
+<script src="/weinre/common/MessageDispatcher.transportd.js"></script>
<script src="/weinre/common/WebSocketXhr.transportd.js"></script>
<script src="/weinre/common/Binding.transportd.js"></script>
<script src="/weinre/common/Callback.transportd.js"></script>
diff --git a/weinre.web/modules/weinre/client/Client.scoop b/weinre.web/modules/weinre/client/Client.scoop
index 3c2c3b0..1fd7afa 100644
--- a/weinre.web/modules/weinre/client/Client.scoop
+++ b/weinre.web/modules/weinre/client/Client.scoop
@@ -9,7 +9,7 @@
requireClass ../common/IDLTools
requireClass ../common/Callback
requireClass ../common/Weinre
-requireClass ../common/Socket
+requireClass ../common/MessageDispatcher
requireClass ../common/Binding
requireClass ./InspectorBackendImpl
@@ -58,17 +58,17 @@
window.addEventListener("load", Binding(this, "onLoaded"), false)
// create the socket
- var webSocket = new Socket("../ws/client")
- Weinre.webSocket = webSocket
+ var messageDispatcher = new MessageDispatcher("../ws/client")
+ Weinre.messageDispatcher = messageDispatcher
// finish setting up InspectorBackend
InspectorBackendImpl.setupProxies()
// create the client commands proxy
- Weinre.WeinreClientCommands = webSocket.createProxy("WeinreClientCommands")
+ Weinre.WeinreClientCommands = messageDispatcher.createProxy("WeinreClientCommands")
// register WebInspector interface
- webSocket.registerInterface("WebInspector", WebInspector, false)
+ messageDispatcher.registerInterface("WebInspector", WebInspector, false)
//-----------------------------------------------------------------------------
method uiAvailable
@@ -119,12 +119,12 @@
this._installRemotePanel()
- var webSocket = Weinre.webSocket
+ var messageDispatcher = Weinre.messageDispatcher
// Weinre.Socket.verbose(true)
- webSocket.registerInterface("WeinreClientEvents", new WeinreClientEventsImpl(this), true)
- webSocket.registerInterface("InspectorFrontendHost", InspectorFrontendHost, true)
+ messageDispatcher.registerInterface("WeinreClientEvents", new WeinreClientEventsImpl(this), true)
+ messageDispatcher.registerInterface("InspectorFrontendHost", InspectorFrontendHost, true)
Weinre.WeinreClientCommands.registerClient(Binding(this, this.cb_registerClient))
@@ -139,7 +139,7 @@
WebInspector.panels.remote.afterInitialConnection()
}
- Weinre.webSocket.getWebSocket().addEventListener("close", Binding(this, this.cb_webSocketClosed))
+ Weinre.messageDispatcher.getWebSocket().addEventListener("close", Binding(this, this.cb_webSocketClosed))
//-----------------------------------------------------------------------------
method cb_webSocketClosed
diff --git a/weinre.web/modules/weinre/client/InspectorBackendImpl.scoop b/weinre.web/modules/weinre/client/InspectorBackendImpl.scoop
index 472fb52..c7f2ca6 100644
--- a/weinre.web/modules/weinre/client/InspectorBackendImpl.scoop
+++ b/weinre.web/modules/weinre/client/InspectorBackendImpl.scoop
@@ -8,13 +8,13 @@
requireClass ../common/Ex
requireClass ../common/IDLTools
-requireClass ../common/Socket
+requireClass ../common/MessageDispatcher
requireClass ../common/Weinre
//-----------------------------------------------------------------------------
class InspectorBackendImpl
this.registeredDomainDispatchers = {}
- Socket.setInspectorBackend(this)
+ MessageDispatcher.setInspectorBackend(this)
//-----------------------------------------------------------------------------
static method setupProxies
@@ -36,7 +36,7 @@
]
intfNames.forEach(function(intfName) {
- var proxy = Weinre.webSocket.createProxy(intfName)
+ var proxy = Weinre.messageDispatcher.createProxy(intfName)
var intf = IDLTools.getIDL(intfName)
if (!intf) {
diff --git a/weinre.web/modules/weinre/common/Socket.scoop b/weinre.web/modules/weinre/common/MessageDispatcher.scoop
similarity index 100%
rename from weinre.web/modules/weinre/common/Socket.scoop
rename to weinre.web/modules/weinre/common/MessageDispatcher.scoop
diff --git a/weinre.web/modules/weinre/target/Target.scoop b/weinre.web/modules/weinre/target/Target.scoop
index d5a1408..78894df 100644
--- a/weinre.web/modules/weinre/target/Target.scoop
+++ b/weinre.web/modules/weinre/target/Target.scoop
@@ -9,7 +9,7 @@
requireClass ../common/Ex
requireClass ../common/Binding
requireClass ../common/Callback
-requireClass ../common/Socket
+requireClass ../common/MessageDispatcher
requireClass ../common/Weinre
requireClass ./NodeStore
@@ -92,8 +92,8 @@
window.addEventListener("load", Binding(this, "onLoaded"), false)
- var webSocket = new Socket(window.WeinreServerURL + "ws/target")
- Weinre.webSocket = webSocket
+ var messageDispatcher = new MessageDispatcher(window.WeinreServerURL + "ws/target")
+ Weinre.messageDispatcher = messageDispatcher
Weinre.wi = {}
@@ -111,39 +111,36 @@
Weinre.wi.Profiler = new WiProfilerImpl()
Weinre.wi.Runtime = new WiRuntimeImpl()
- webSocket.registerInterface("ApplicationCache", Weinre.wi.ApplicationCache , true)
- webSocket.registerInterface("BrowserDebugger" , Weinre.wi.BrowserDebugger , true)
- webSocket.registerInterface("Console", Weinre.wi.Console , true)
- webSocket.registerInterface("CSS", Weinre.wi.CSS , true)
- webSocket.registerInterface("Database", Weinre.wi.Database , true)
- webSocket.registerInterface("Debugger", Weinre.wi.Debugger , true)
- webSocket.registerInterface("DOM", Weinre.wi.DOM , true)
- webSocket.registerInterface("DOMStorage", Weinre.wi.DOMStorage , true)
- webSocket.registerInterface("InjectedScript", Weinre.wi.InjectedScript , true)
- webSocket.registerInterface("Inspector", Weinre.wi.Inspector , true)
- webSocket.registerInterface("Network", Weinre.wi.Network , true)
- webSocket.registerInterface("Profiler", Weinre.wi.Profiler , true)
- webSocket.registerInterface("Runtime", Weinre.wi.Runtime , true)
+ messageDispatcher.registerInterface("ApplicationCache", Weinre.wi.ApplicationCache , true)
+ messageDispatcher.registerInterface("BrowserDebugger" , Weinre.wi.BrowserDebugger , true)
+ messageDispatcher.registerInterface("Console", Weinre.wi.Console , true)
+ messageDispatcher.registerInterface("CSS", Weinre.wi.CSS , true)
+ messageDispatcher.registerInterface("Database", Weinre.wi.Database , true)
+ messageDispatcher.registerInterface("Debugger", Weinre.wi.Debugger , true)
+ messageDispatcher.registerInterface("DOM", Weinre.wi.DOM , true)
+ messageDispatcher.registerInterface("DOMStorage", Weinre.wi.DOMStorage , true)
+ messageDispatcher.registerInterface("InjectedScript", Weinre.wi.InjectedScript , true)
+ messageDispatcher.registerInterface("Inspector", Weinre.wi.Inspector , true)
+ messageDispatcher.registerInterface("Network", Weinre.wi.Network , true)
+ messageDispatcher.registerInterface("Profiler", Weinre.wi.Profiler , true)
+ messageDispatcher.registerInterface("Runtime", Weinre.wi.Runtime , true)
- webSocket.registerInterface("WeinreTargetEvents", new WeinreTargetEventsImpl(), true)
+ messageDispatcher.registerInterface("WeinreTargetEvents", new WeinreTargetEventsImpl(), true)
- Weinre.wi.ApplicationCacheNotify = webSocket.createProxy("ApplicationCacheNotify")
- Weinre.wi.ConsoleNotify = webSocket.createProxy("ConsoleNotify")
- Weinre.wi.DOMNotify = webSocket.createProxy("DOMNotify")
- Weinre.wi.DOMStorageNotify = webSocket.createProxy("DOMStorageNotify")
- Weinre.wi.DatabaseNotify = webSocket.createProxy("DatabaseNotify")
- Weinre.wi.DebuggerNotify = webSocket.createProxy("DebuggerNotify")
- Weinre.wi.InspectorNotify = webSocket.createProxy("InspectorNotify")
- Weinre.wi.NetworkNotify = webSocket.createProxy("NetworkNotify")
- Weinre.wi.ProfilerNotify = webSocket.createProxy("ProfilerNotify")
- Weinre.wi.TimelineNotify = webSocket.createProxy("TimelineNotify")
+ Weinre.wi.ApplicationCacheNotify = messageDispatcher.createProxy("ApplicationCacheNotify")
+ Weinre.wi.ConsoleNotify = messageDispatcher.createProxy("ConsoleNotify")
+ Weinre.wi.DOMNotify = messageDispatcher.createProxy("DOMNotify")
+ Weinre.wi.DOMStorageNotify = messageDispatcher.createProxy("DOMStorageNotify")
+ Weinre.wi.DatabaseNotify = messageDispatcher.createProxy("DatabaseNotify")
+ Weinre.wi.DebuggerNotify = messageDispatcher.createProxy("DebuggerNotify")
+ Weinre.wi.InspectorNotify = messageDispatcher.createProxy("InspectorNotify")
+ Weinre.wi.NetworkNotify = messageDispatcher.createProxy("NetworkNotify")
+ Weinre.wi.ProfilerNotify = messageDispatcher.createProxy("ProfilerNotify")
+ Weinre.wi.TimelineNotify = messageDispatcher.createProxy("TimelineNotify")
- Weinre.WeinreTargetCommands = webSocket.createProxy("WeinreTargetCommands")
-// window.WebInspector = webSocket.createProxy("WebInspector")
+ Weinre.WeinreTargetCommands = messageDispatcher.createProxy("WeinreTargetCommands")
-// Weinre.Socket.verbose(true)
-// webSocket.open()
- webSocket._socket.addEventListener("open", Binding(this, this.cb_webSocketOpened))
+ messageDispatcher.getWebSocket().addEventListener("open", Binding(this, this.cb_webSocketOpened))
Weinre.nodeStore = new NodeStore()
Weinre.cssStore = new CSSStore()