diff --git a/devtools/server/actors/child-process.js b/devtools/server/actors/child-process.js index cbbcc62dcd8d..521487c6736f 100644 --- a/devtools/server/actors/child-process.js +++ b/devtools/server/actors/child-process.js @@ -6,7 +6,7 @@ const { Cc, Ci, Cu } = require("chrome"); -const { ChromeDebuggerActor } = require("devtools/server/actors/chrome-debugger"); +const { ChromeDebuggerActor } = require("devtools/server/actors/script"); const { WebConsoleActor } = require("devtools/server/actors/webconsole"); const makeDebugger = require("devtools/server/actors/utils/make-debugger"); const { ActorPool } = require("devtools/server/main"); @@ -75,7 +75,7 @@ ChildProcessActor.prototype = { } if (!this.threadActor) { - this.threadActor = new ChromeDebuggerActor(this); + this.threadActor = new ChromeDebuggerActor(this.conn, this); this._contextPool.addActor(this.threadActor); } diff --git a/devtools/server/actors/chrome-debugger.js b/devtools/server/actors/chrome-debugger.js deleted file mode 100644 index 7dadd19d7c78..000000000000 --- a/devtools/server/actors/chrome-debugger.js +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2; js-indent-level: 2 -*- */ -/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; - -const { ActorClass } = require("devtools/server/protocol"); -const { ThreadActor } = require("devtools/server/actors/script"); - -/** - * ChromeDebuggerActor is a thin wrapper over ThreadActor, slightly changing - * some of its behavior. - */ -let ChromeDebuggerActor = ActorClass({ - typeName: "chromeDebugger", - extends: ThreadActor, - - /** - * Create the actor. - * - * @param parent object - * This actor's parent actor. See ThreadActor for a list of expected - * properties. - */ - initialize: function(parent) { - ThreadActor.call(this, parent); - } -}); - -exports.ChromeDebuggerActor = ChromeDebuggerActor; diff --git a/devtools/server/actors/moz.build b/devtools/server/actors/moz.build index 2fe0642e013c..f544b7bb0f47 100644 --- a/devtools/server/actors/moz.build +++ b/devtools/server/actors/moz.build @@ -17,7 +17,6 @@ DevToolsModules( 'canvas.js', 'child-process.js', 'childtab.js', - 'chrome-debugger.js', 'chrome.js', 'common.js', 'csscoverage.js', diff --git a/devtools/server/actors/script.js b/devtools/server/actors/script.js index d55221031e3b..5493db527b99 100644 --- a/devtools/server/actors/script.js +++ b/devtools/server/actors/script.js @@ -3394,6 +3394,36 @@ function hackDebugger(Debugger) { }); } + +/** + * Creates an actor for handling chrome debugging. ChromeDebuggerActor is a + * thin wrapper over ThreadActor, slightly changing some of its behavior. + * + * @param aConnection object + * The DebuggerServerConnection with which this ChromeDebuggerActor + * is associated. (Currently unused, but required to make this + * constructor usable with addGlobalActor.) + * + * @param aParent object + * This actor's parent actor. See ThreadActor for a list of expected + * properties. + */ +function ChromeDebuggerActor(aConnection, aParent) +{ + ThreadActor.call(this, aParent); +} + +ChromeDebuggerActor.prototype = Object.create(ThreadActor.prototype); + +update(ChromeDebuggerActor.prototype, { + constructor: ChromeDebuggerActor, + + // A constant prefix that will be used to form the actor ID by the server. + actorPrefix: "chromeDebugger" +}); + +exports.ChromeDebuggerActor = ChromeDebuggerActor; + /** * Creates an actor for handling add-on debugging. AddonThreadActor is * a thin wrapper over ThreadActor.