Bug 1277947 - Use ActorClassWithSpec for the ThreadActor; r=ejpbruel
authorNick Fitzgerald <fitzgen@gmail.com>
Mon, 06 Jun 2016 10:24:34 -0700
changeset 300618 35e352737458a1c715c34bf96c5aa301d7ba75fb
parent 300617 e3991163c175e3b56b41212ca28a2b7b9125c69a
child 300619 9565f97ec755feb27c08a171a8d6cbaed2870a58
push id19562
push usernfitzgerald@mozilla.com
push dateMon, 06 Jun 2016 17:24:48 +0000
treeherderfx-team@a325b8ebc115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersejpbruel
bugs1277947
milestone49.0a1
Bug 1277947 - Use ActorClassWithSpec for the ThreadActor; r=ejpbruel
devtools/server/actors/script.js
devtools/shared/specs/moz.build
devtools/shared/specs/script.js
--- a/devtools/server/actors/script.js
+++ b/devtools/server/actors/script.js
@@ -10,25 +10,26 @@ const Services = require("Services");
 const { Cc, Ci, Cu, Cr, components, ChromeWorker } = require("chrome");
 const { ActorPool, OriginalLocation, GeneratedLocation } = require("devtools/server/actors/common");
 const { BreakpointActor, setBreakpointAtEntryPoints } = require("devtools/server/actors/breakpoint");
 const { EnvironmentActor } = require("devtools/server/actors/environment");
 const { FrameActor } = require("devtools/server/actors/frame");
 const { ObjectActor, createValueGrip, longStringGrip } = require("devtools/server/actors/object");
 const { SourceActor, getSourceURL } = require("devtools/server/actors/source");
 const { DebuggerServer } = require("devtools/server/main");
-const { ActorClass } = require("devtools/shared/protocol");
+const { ActorClassWithSpec } = require("devtools/shared/protocol");
 const DevToolsUtils = require("devtools/shared/DevToolsUtils");
 const { assert, dumpn, update, fetch } = DevToolsUtils;
 const promise = require("promise");
 const PromiseDebugging = require("PromiseDebugging");
 const xpcInspector = require("xpcInspector");
 const ScriptStore = require("./utils/ScriptStore");
 const { DevToolsWorker } = require("devtools/shared/worker/worker");
 const object = require("sdk/util/object");
+const { threadSpec } = require("devtools/shared/specs/script");
 
 const { defer, resolve, reject, all } = promise;
 
 loader.lazyGetter(this, "Debugger", () => {
   let Debugger = require("Debugger");
   hackDebugger(Debugger);
   return Debugger;
 });
@@ -403,19 +404,17 @@ EventLoop.prototype = {
  *          - preNest: Function called before entering a nested event loop.
  *          - postNest: Function called after exiting a nested event loop.
  *          - makeDebugger: A function that takes no arguments and instantiates
  *            a Debugger that manages its globals on its own.
  * @param aGlobal object [optional]
  *        An optional (for content debugging only) reference to the content
  *        window.
  */
-const ThreadActor = ActorClass({
-  typeName: "context",
-
+const ThreadActor = ActorClassWithSpec(threadSpec, {
   initialize: function (aParent, aGlobal) {
     this._state = "detached";
     this._frameActors = [];
     this._parent = aParent;
     this._dbg = null;
     this._gripDepth = 0;
     this._threadLifetimePool = null;
     this._tabClosed = false;
--- a/devtools/shared/specs/moz.build
+++ b/devtools/shared/specs/moz.build
@@ -12,16 +12,17 @@ DevToolsModules(
     'call-watcher.js',
     'canvas.js',
     'css-properties.js',
     'heap-snapshot-file.js',
     'highlighters.js',
     'inspector.js',
     'node.js',
     'preference.js',
+    'script.js',
     'settings.js',
     'source.js',
     'storage.js',
     'styleeditor.js',
     'styles.js',
     'stylesheets.js',
     'webaudio.js',
     'webgl.js'
new file mode 100644
--- /dev/null
+++ b/devtools/shared/specs/script.js
@@ -0,0 +1,14 @@
+/* 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 {generateActorSpec} = require("devtools/shared/protocol");
+
+const threadSpec = generateActorSpec({
+  typeName: "context",
+
+  methods: {},
+});
+
+exports.threadSpec = threadSpec;