Bug 1196047 - Move shared/shared perf files to server/performance. r=jsantell draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Wed, 07 Oct 2015 18:09:35 -0500
changeset 299489 5fb0032d26d3cb3ec26e9b7a8207de790fb70ae4
parent 299488 12daecd8b29a9e2e8eb5e447f3fc5651f70e8a11
child 299490 547b4cdfd99ab9a5f01276973d7b1dbb0790cab0
push id6216
push userjryans@gmail.com
push dateWed, 07 Oct 2015 23:18:00 +0000
reviewersjsantell
bugs1196047
milestone44.0a1
Bug 1196047 - Move shared/shared perf files to server/performance. r=jsantell
devtools/server/actors/common.js
devtools/server/actors/framerate.js
devtools/server/actors/memory.js
devtools/server/actors/profiler.js
devtools/server/actors/timeline.js
devtools/server/performance/framerate.js
devtools/server/performance/memory.js
devtools/server/performance/moz.build
devtools/server/performance/profiler.js
devtools/server/performance/recorder.js
devtools/server/performance/timeline.js
devtools/shared/moz.build
devtools/shared/shared/framerate.js
devtools/shared/shared/memory.js
devtools/shared/shared/moz.build
devtools/shared/shared/profiler.js
devtools/shared/shared/timeline.js
--- a/devtools/server/actors/common.js
+++ b/devtools/server/actors/common.js
@@ -522,17 +522,17 @@ function expectState(expectedState, meth
 exports.expectState = expectState;
 
 /**
  * Proxies a call from an actor to an underlying module, stored
  * as `bridge` on the actor. This allows a module to be defined in one
  * place, usable by other modules/actors on the server, but a separate
  * module defining the actor/RDP definition.
  *
- * @see Framerate implementation: devtools/shared/shared/framerate.js
+ * @see Framerate implementation: devtools/server/performance/framerate.js
  * @see Framerate actor definition: devtools/server/actors/framerate.js
  */
 function actorBridge (methodName, definition={}) {
   return method(function () {
     return this.bridge[methodName].apply(this.bridge, arguments);
   }, definition);
 }
 exports.actorBridge = actorBridge;
--- a/devtools/server/actors/framerate.js
+++ b/devtools/server/actors/framerate.js
@@ -2,23 +2,23 @@
  * 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 protocol = require("devtools/server/protocol");
 const { actorBridge } = require("devtools/server/actors/common");
 const { method, custom, Arg, Option, RetVal } = protocol;
 const { on, once, off, emit } = require("sdk/event/core");
-const { Framerate } = require("devtools/shared/shared/framerate");
+const { Framerate } = require("devtools/server/performance/framerate");
 
 /**
  * An actor wrapper around Framerate. Uses exposed
  * methods via bridge and provides RDP definitions.
  *
- * @see devtools/shared/shared/framerate.js for documentation.
+ * @see devtools/server/performance/framerate.js for documentation.
  */
 var FramerateActor = exports.FramerateActor = protocol.ActorClass({
   typeName: "framerate",
   initialize: function (conn, tabActor) {
     protocol.Actor.prototype.initialize.call(this, conn);
     this.bridge = new Framerate(tabActor);
   },
   destroy: function(conn) {
--- a/devtools/server/actors/memory.js
+++ b/devtools/server/actors/memory.js
@@ -2,17 +2,17 @@
  * 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 { Cc, Ci, Cu, components } = require("chrome");
 const protocol = require("devtools/server/protocol");
 const { method, RetVal, Arg, types } = protocol;
-const { Memory } = require("devtools/shared/shared/memory");
+const { Memory } = require("devtools/server/performance/memory");
 const { actorBridge } = require("devtools/server/actors/common");
 loader.lazyRequireGetter(this, "events", "sdk/event/core");
 loader.lazyRequireGetter(this, "StackFrameCache",
                          "devtools/server/actors/utils/stack", true);
 loader.lazyRequireGetter(this, "FileUtils",
                          "resource://gre/modules/FileUtils.jsm", true);
 loader.lazyRequireGetter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm", true);
 loader.lazyRequireGetter(this, "Task", "resource://gre/modules/Task.jsm", true);
@@ -33,20 +33,20 @@ types.addDictType("AllocationsRecordingO
 });
 
 /**
  * An actor that returns memory usage data for its parent actor's window.
  * A tab-scoped instance of this actor will measure the memory footprint of its
  * parent tab. A global-scoped instance however, will measure the memory
  * footprint of the chrome window referenced by the root actor.
  *
- * This actor wraps the Memory module at devtools/shared/shared/memory.js
+ * This actor wraps the Memory module at devtools/server/performance/memory.js
  * and provides RDP definitions.
  *
- * @see devtools/shared/shared/memory.js for documentation.
+ * @see devtools/server/performance/memory.js for documentation.
  */
 var MemoryActor = exports.MemoryActor = protocol.ActorClass({
   typeName: "memory",
 
   /**
    * The set of unsolicited events the MemoryActor emits that will be sent over
    * the RDP (by protocol.js).
    */
--- a/devtools/server/actors/profiler.js
+++ b/devtools/server/actors/profiler.js
@@ -2,17 +2,17 @@
  * 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 { Cu } = require("chrome");
 const protocol = require("devtools/server/protocol");
 const { custom, method, RetVal, Arg, Option, types } = protocol;
-const { Profiler } = require("devtools/shared/shared/profiler");
+const { Profiler } = require("devtools/server/performance/profiler");
 const { actorBridge } = require("devtools/server/actors/common");
 
 loader.lazyRequireGetter(this, "events", "sdk/event/core");
 loader.lazyRequireGetter(this, "extend", "sdk/util/object", true);
 
 types.addType("profiler-data", {
   // On Fx42+, the profile is only deserialized on the front; older
   // servers will get the profiler data as an object from nsIProfiler,
@@ -25,20 +25,20 @@ types.addType("profiler-data", {
       newValue.currentTime = v.currentTime;
       return newValue;
     }
     return v;
   }
 });
 
 /**
- * This actor wraps the Profiler module at devtools/shared/shared/profiler.js
+ * This actor wraps the Profiler module at devtools/server/performance/profiler.js
  * and provides RDP definitions.
  *
- * @see devtools/shared/shared/profiler.js for documentation.
+ * @see devtools/server/performance/profiler.js for documentation.
  */
 var ProfilerActor = exports.ProfilerActor = protocol.ActorClass({
   typeName: "profiler",
 
   /**
    * The set of events the ProfilerActor emits over RDP.
    */
   events: {
--- a/devtools/server/actors/timeline.js
+++ b/devtools/server/actors/timeline.js
@@ -4,27 +4,27 @@
 "use strict";
 
 /**
  * Many Gecko operations (painting, reflows, restyle, ...) can be tracked
  * in real time. A marker is a representation of one operation. A marker
  * has a name, start and end timestamps. Markers are stored in docShells.
  *
  * This actor exposes this tracking mechanism to the devtools protocol.
- * Most of the logic is handled in devtools/shared/shared/timeline.js
+ * Most of the logic is handled in devtools/server/performance/timeline.js
  * This just wraps that module up and exposes it via RDP.
  *
  * For more documentation:
- * @see devtools/shared/shared/timeline.js
+ * @see devtools/server/performance/timeline.js
  */
 
 const protocol = require("devtools/server/protocol");
 const { method, Arg, RetVal, Option } = protocol;
 const events = require("sdk/event/core");
-const { Timeline } = require("devtools/shared/shared/timeline");
+const { Timeline } = require("devtools/server/performance/timeline");
 const { actorBridge } = require("devtools/server/actors/common");
 
 /**
  * Type representing an array of numbers as strings, serialized fast(er).
  * http://jsperf.com/json-stringify-parse-vs-array-join-split/3
  *
  * XXX: It would be nice if on local connections (only), we could just *give*
  * the array directly to the front, instead of going through all this
rename from devtools/shared/shared/framerate.js
rename to devtools/server/performance/framerate.js
rename from devtools/shared/shared/memory.js
rename to devtools/server/performance/memory.js
--- a/devtools/server/performance/moz.build
+++ b/devtools/server/performance/moz.build
@@ -4,12 +4,16 @@
 # 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/.
 
 DIRS += [
     'legacy',
 ]
 
 DevToolsModules(
+    'framerate.js',
     'io.js',
+    'memory.js',
+    'profiler.js',
     'recorder.js',
     'recording-common.js',
+    'timeline.js',
 )
rename from devtools/shared/shared/profiler.js
rename to devtools/server/performance/profiler.js
--- a/devtools/server/performance/recorder.js
+++ b/devtools/server/performance/recorder.js
@@ -13,21 +13,21 @@ loader.lazyRequireGetter(this, "extend",
 loader.lazyRequireGetter(this, "Class",
   "sdk/core/heritage", true);
 loader.lazyRequireGetter(this, "EventTarget",
   "sdk/event/target", true);
 loader.lazyRequireGetter(this, "events",
   "sdk/event/core");
 
 loader.lazyRequireGetter(this, "Memory",
-  "devtools/shared/shared/memory", true);
+  "devtools/server/performance/memory", true);
 loader.lazyRequireGetter(this, "Timeline",
-  "devtools/shared/shared/timeline", true);
+  "devtools/server/performance/timeline", true);
 loader.lazyRequireGetter(this, "Profiler",
-  "devtools/shared/shared/profiler", true);
+  "devtools/server/performance/profiler", true);
 loader.lazyRequireGetter(this, "PerformanceRecordingActor",
   "devtools/server/actors/performance-recording", true);
 loader.lazyRequireGetter(this, "PerformanceRecordingFront",
   "devtools/server/actors/performance-recording", true);
 loader.lazyRequireGetter(this, "mapRecordingOptions",
   "devtools/shared/performance/utils", true);
 loader.lazyRequireGetter(this, "DevToolsUtils",
   "devtools/shared/DevToolsUtils");
rename from devtools/shared/shared/timeline.js
rename to devtools/server/performance/timeline.js
--- a/devtools/shared/shared/timeline.js
+++ b/devtools/server/performance/timeline.js
@@ -22,18 +22,18 @@
 
 const { Ci, Cu } = require("chrome");
 const { Class } = require("sdk/core/heritage");
 // Be aggressive about lazy loading, as this will run on every
 // toolbox startup
 loader.lazyRequireGetter(this, "events", "sdk/event/core");
 loader.lazyRequireGetter(this, "Timers", "sdk/timers");
 loader.lazyRequireGetter(this, "Task", "resource://gre/modules/Task.jsm", true);
-loader.lazyRequireGetter(this, "Memory", "devtools/shared/shared/memory", true);
-loader.lazyRequireGetter(this, "Framerate", "devtools/shared/shared/framerate", true);
+loader.lazyRequireGetter(this, "Memory", "devtools/server/performance/memory", true);
+loader.lazyRequireGetter(this, "Framerate", "devtools/server/performance/framerate", true);
 loader.lazyRequireGetter(this, "StackFrameCache", "devtools/server/actors/utils/stack", true);
 loader.lazyRequireGetter(this, "EventTarget", "sdk/event/target", true);
 
 // How often do we pull markers from the docShells, and therefore, how often do
 // we send events to the front (knowing that when there are no markers in the
 // docShell, no event is sent).
 const DEFAULT_TIMELINE_DATA_PULL_TIMEOUT = 200; // ms
 
--- a/devtools/shared/moz.build
+++ b/devtools/shared/moz.build
@@ -15,17 +15,16 @@ DIRS += [
     'heapsnapshot',
     'jsbeautify',
     'layout',
     'performance',
     'pretty-fast',
     'qrcode',
     'security',
     'sourcemap',
-    'shared',
     'shims',
     'styleinspector',
     'tern',
     'touch',
     'transport',
     'webconsole'
 ]
 
deleted file mode 100644
--- a/devtools/shared/shared/moz.build
+++ /dev/null
@@ -1,12 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# 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/.
-
-DevToolsModules(
-  'framerate.js',
-  'memory.js',
-  'profiler.js',
-  'timeline.js',
-)