Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1145)

Unified Diff: Source/devtools/front_end/sdk/InspectorBackend.js

Issue 392603002: DevTools: refactoring connection creation, removing a couple of dead code branches. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/front_end/sdk/WorkerManager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/InspectorBackend.js
diff --git a/Source/devtools/front_end/sdk/InspectorBackend.js b/Source/devtools/front_end/sdk/InspectorBackend.js
index 588f27948fae67be8ceb622f8b0efda0266c24c3..5e881df63ae402a968fa708c9161a27c527bc5d2 100644
--- a/Source/devtools/front_end/sdk/InspectorBackend.js
+++ b/Source/devtools/front_end/sdk/InspectorBackend.js
@@ -558,12 +558,10 @@ InspectorBackendClass.Connection.prototype = {
/**
* @constructor
* @extends {InspectorBackendClass.Connection}
- * @param {!function(!InspectorBackendClass.Connection)} onConnectionReady
*/
-InspectorBackendClass.MainConnection = function(onConnectionReady)
+InspectorBackendClass.MainConnection = function()
{
InspectorBackendClass.Connection.call(this);
- onConnectionReady(this);
InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.DispatchMessage, this._dispatchMessage, this);
}
@@ -605,6 +603,15 @@ InspectorBackendClass.WebSocketConnection = function(url, onConnectionReady)
this._socket.onclose = this.fireDisconnected.bind(this, "websocket_closed");
}
+/**
+ * @param {string} url
+ * @param {!function(!InspectorBackendClass.Connection)} onConnectionReady
+ */
+InspectorBackendClass.WebSocketConnection.Create = function(url, onConnectionReady)
+{
+ new InspectorBackendClass.WebSocketConnection(url, onConnectionReady);
+}
+
InspectorBackendClass.WebSocketConnection.prototype = {
/**
@@ -640,12 +647,10 @@ InspectorBackendClass.WebSocketConnection.prototype = {
/**
* @constructor
* @extends {InspectorBackendClass.Connection}
- * @param {!function(!InspectorBackendClass.Connection)} onConnectionReady
*/
-InspectorBackendClass.StubConnection = function(onConnectionReady)
+InspectorBackendClass.StubConnection = function()
{
InspectorBackendClass.Connection.call(this);
- onConnectionReady(this);
}
InspectorBackendClass.StubConnection.prototype = {
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/front_end/sdk/WorkerManager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698