Bug 1167300 - Fix all performance tool imports to work with the new file locations, r=jsantell, a=sledru
authorVictor Porof <vporof@mozilla.com>
Fri, 22 May 2015 16:25:52 -0400
changeset 274870 980d943b262c84ba3fa0e1a15428b7f88d93e2ae
parent 274869 b6618222aa95979961ec741c231354170b1d0bc0
child 274871 1606aab5216f89bbc29f96da0869d9d93541b1da
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjsantell, sledru
bugs1167300
milestone40.0a2
Bug 1167300 - Fix all performance tool imports to work with the new file locations, r=jsantell, a=sledru
browser/devtools/performance/modules/global.js
browser/devtools/performance/modules/logic/actors.js
browser/devtools/performance/modules/logic/compatibility.js
browser/devtools/performance/modules/logic/frame-utils.js
browser/devtools/performance/modules/logic/front.js
browser/devtools/performance/modules/logic/marker-utils.js
browser/devtools/performance/modules/logic/recording-model.js
browser/devtools/performance/modules/logic/tree-model.js
browser/devtools/performance/modules/widgets/graphs.js
browser/devtools/performance/modules/widgets/marker-details.js
browser/devtools/performance/modules/widgets/markers-overview.js
browser/devtools/performance/modules/widgets/tree-view.js
browser/devtools/performance/modules/widgets/waterfall.js
browser/devtools/performance/panel.js
browser/devtools/performance/performance-controller.js
browser/devtools/performance/performance-view.js
browser/devtools/performance/system.js
browser/devtools/performance/test/browser_marker-utils.js
browser/devtools/performance/test/browser_perf-events-calltree.js
browser/devtools/performance/test/browser_perf-jit-model-01.js
browser/devtools/performance/test/browser_perf-jit-model-02.js
browser/devtools/performance/test/browser_perf-jit-view-02.js
browser/devtools/performance/test/browser_profiler-frame-utils-01.js
browser/devtools/performance/test/browser_profiler_categories.js
browser/devtools/performance/test/browser_profiler_content-check.js
browser/devtools/performance/test/browser_profiler_tree-frame-node.js
browser/devtools/performance/test/browser_profiler_tree-model-01.js
browser/devtools/performance/test/browser_profiler_tree-model-02.js
browser/devtools/performance/test/browser_profiler_tree-model-03.js
browser/devtools/performance/test/browser_profiler_tree-model-04.js
browser/devtools/performance/test/browser_profiler_tree-model-05.js
browser/devtools/performance/test/browser_profiler_tree-model-06.js
browser/devtools/performance/test/browser_profiler_tree-model-07.js
browser/devtools/performance/test/browser_profiler_tree-view-01.js
browser/devtools/performance/test/browser_profiler_tree-view-02.js
browser/devtools/performance/test/browser_profiler_tree-view-03.js
browser/devtools/performance/test/browser_profiler_tree-view-04.js
browser/devtools/performance/test/browser_profiler_tree-view-05.js
browser/devtools/performance/test/browser_profiler_tree-view-06.js
browser/devtools/performance/test/browser_profiler_tree-view-07.js
browser/devtools/performance/test/browser_profiler_tree-view-08.js
browser/devtools/performance/test/browser_profiler_tree-view-09.js
browser/devtools/performance/test/browser_timeline-blueprint.js
browser/devtools/performance/test/browser_timeline-waterfall-sidebar.js
browser/devtools/performance/views/details-js-call-tree.js
browser/devtools/shared/test/browser_flame-graph-utils-03.js
browser/devtools/shared/test/browser_flame-graph-utils-04.js
browser/devtools/shared/widgets/FlameGraph.js
--- a/browser/devtools/performance/modules/global.js
+++ b/browser/devtools/performance/modules/global.js
@@ -1,17 +1,15 @@
 /* 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 {Cc, Ci, Cu, Cr} = require("chrome");
-loader.lazyRequireGetter(this, "ViewHelpers",
-  "resource:///modules/devtools/ViewHelpers.jsm", true);
-loader.lazyRequireGetter(this, "Services");
+const { Cc, Ci, Cu, Cr } = require("chrome");
+const { ViewHelpers } = require("resource:///modules/devtools/ViewHelpers.jsm");
 
 // String used to fill in platform data when it should be hidden.
 const GECKO_SYMBOL = "(Gecko)";
 
 /**
  * Localization convenience methods.
  + TODO: merge these into a single file: Bug 1082695.
  */
--- a/browser/devtools/performance/modules/logic/actors.js
+++ b/browser/devtools/performance/modules/logic/actors.js
@@ -1,31 +1,29 @@
 /* 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 { Task } = require("resource://gre/modules/Task.jsm");
-const { Promise } = require("resource://gre/modules/Promise.jsm");
-const {
-  actorCompatibilityBridge, getProfiler,
-  MockMemoryFront, MockTimelineFront,
-  memoryActorSupported, timelineActorSupported
-} = require("devtools/performance/compatibility");
 
+loader.lazyRequireGetter(this, "promise");
 loader.lazyRequireGetter(this, "EventEmitter",
   "devtools/toolkit/event-emitter");
+loader.lazyRequireGetter(this, "Poller",
+  "devtools/shared/poller", true);
+
+loader.lazyRequireGetter(this, "CompatUtils",
+  "devtools/performance/compatibility");
 loader.lazyRequireGetter(this, "RecordingUtils",
   "devtools/performance/recording-utils", true);
 loader.lazyRequireGetter(this, "TimelineFront",
   "devtools/server/actors/timeline", true);
 loader.lazyRequireGetter(this, "MemoryFront",
   "devtools/server/actors/memory", true);
-loader.lazyRequireGetter(this, "Poller",
-  "devtools/shared/poller", true);
 
 // how often do we pull allocation sites from the memory actor
 const ALLOCATION_SITE_POLL_TIMER = 200; // ms
 
 // how often do we check the status of the profiler's circular buffer
 const PROFILER_CHECK_TIMER = 5000; // ms
 
 const MEMORY_ACTOR_METHODS = [
@@ -55,17 +53,17 @@ function ProfilerFrontFacade (target) {
 }
 
 ProfilerFrontFacade.prototype = {
   EVENTS: ["console-api-profiler", "profiler-stopped"],
 
   // Connects to the targets underlying real ProfilerFront.
   connect: Task.async(function*() {
     let target = this._target;
-    this._actor = yield getProfiler(target);
+    this._actor = yield CompatUtils.getProfiler(target);
 
     // Fetch and store information about the SPS profiler and
     // server profiler.
     this.traits = {};
     this.traits.filterable = target.getTrait("profilerDataFilterable");
 
     // Directly register to event notifications when connected
     // to hook into `console.profile|profileEnd` calls.
@@ -135,17 +133,17 @@ ProfilerFrontFacade.prototype = {
   stop: Task.async(function *() {
     yield this._poller.off();
   }),
 
   /**
    * Wrapper around `profiler.isActive()` to take profiler status data and emit.
    */
   getStatus: Task.async(function *() {
-    let data = yield (actorCompatibilityBridge("isActive").call(this));
+    let data = yield (CompatUtils.actorCompatibilityBridge("isActive").call(this));
     // If no data, the last poll for `isActive()` was wrapping up, and the target.client
     // is now null, so we no longer have data, so just abort here.
     if (!data) {
       return;
     }
 
     // If TEST_PROFILER_FILTER_STATUS defined (via array of fields), filter
     // out any field from isActive, used only in tests. Used to filter out
@@ -162,17 +160,17 @@ ProfilerFrontFacade.prototype = {
     this.emit("profiler-status", data);
     return data;
   }),
 
   /**
    * Returns profile data from now since `startTime`.
    */
   getProfile: Task.async(function *(options) {
-    let profilerData = yield (actorCompatibilityBridge("getProfile").call(this, options));
+    let profilerData = yield (CompatUtils.actorCompatibilityBridge("getProfile").call(this, options));
     // If the backend is not deduped, dedupe it ourselves, as rest of the code
     // expects a deduped profile.
     if (profilerData.profile.meta.version === 2) {
       RecordingUtils.deflateProfile(profilerData.profile);
     }
 
     // If the backend does not support filtering by start and endtime on platform (< Fx40),
     // do it on the client (much slower).
@@ -205,35 +203,35 @@ ProfilerFrontFacade.prototype = {
     // Calling `getStatus()` will emit the "profiler-status" on its own
     yield this.getStatus();
   }),
 
   toString: () => "[object ProfilerFrontFacade]"
 };
 
 // Bind all the methods that directly proxy to the actor
-PROFILER_ACTOR_METHODS.forEach(method => ProfilerFrontFacade.prototype[method] = actorCompatibilityBridge(method));
+PROFILER_ACTOR_METHODS.forEach(method => ProfilerFrontFacade.prototype[method] = CompatUtils.actorCompatibilityBridge(method));
 exports.ProfilerFront = ProfilerFrontFacade;
 
 /**
  * Constructor for a facade around an underlying TimelineFront.
  */
 function TimelineFrontFacade (target) {
   this._target = target;
   EventEmitter.decorate(this);
 }
 
 TimelineFrontFacade.prototype = {
   EVENTS: ["markers", "frames", "memory", "ticks"],
 
   connect: Task.async(function*() {
-    let supported = yield timelineActorSupported(this._target);
+    let supported = yield CompatUtils.timelineActorSupported(this._target);
     this._actor = supported ?
                   new TimelineFront(this._target.client, this._target.form) :
-                  new MockTimelineFront();
+                  new CompatUtils.MockTimelineFront();
 
     this.IS_MOCK = !supported;
 
     // Binds underlying actor events and consolidates them to a `timeline-data`
     // exposed event.
     this.EVENTS.forEach(type => {
       let handler = this[`_on${type}`] = this._onTimelineData.bind(this, type);
       this._actor.on(type, handler);
@@ -256,35 +254,35 @@ TimelineFrontFacade.prototype = {
   _onTimelineData: function (type, ...data) {
     this.emit("timeline-data", type, ...data);
   },
 
   toString: () => "[object TimelineFrontFacade]"
 };
 
 // Bind all the methods that directly proxy to the actor
-TIMELINE_ACTOR_METHODS.forEach(method => TimelineFrontFacade.prototype[method] = actorCompatibilityBridge(method));
+TIMELINE_ACTOR_METHODS.forEach(method => TimelineFrontFacade.prototype[method] = CompatUtils.actorCompatibilityBridge(method));
 exports.TimelineFront = TimelineFrontFacade;
 
 /**
  * Constructor for a facade around an underlying ProfilerFront.
  */
 function MemoryFrontFacade (target) {
   this._target = target;
   this._pullAllocationSites = this._pullAllocationSites.bind(this);
 
   EventEmitter.decorate(this);
 }
 
 MemoryFrontFacade.prototype = {
   connect: Task.async(function*() {
-    let supported = yield memoryActorSupported(this._target);
+    let supported = yield CompatUtils.memoryActorSupported(this._target);
     this._actor = supported ?
                   new MemoryFront(this._target.client, this._target.form) :
-                  new MockMemoryFront();
+                  new CompatUtils.MockMemoryFront();
 
     this.IS_MOCK = !supported;
   }),
 
   /**
    * Disables polling and destroys actor.
    */
   destroy: Task.async(function *() {
@@ -350,35 +348,35 @@ MemoryFrontFacade.prototype = {
 
   /**
    * At regular intervals, pull allocations from the memory actor, and
    * forward them on this Front facade as "timeline-data" events. This
    * gives the illusion that the MemoryActor supports an EventEmitter-style
    * event stream.
    */
   _pullAllocationSites: Task.async(function *() {
-    let { promise, resolve } = Promise.defer();
-    this._lastPullAllocationSitesFinished = promise;
+    let deferred = promise.defer();
+    this._lastPullAllocationSitesFinished = deferred.promise;
 
     if ((yield this.getState()) !== "attached") {
-      resolve();
+      deferred.resolve();
       return;
     }
 
     let memoryData = yield this.getAllocations();
     // Match the signature of the TimelineFront events, with "timeline-data"
     // being the event name, and the second argument describing the type.
     this.emit("timeline-data", "allocations", {
       sites: memoryData.allocations,
       timestamps: memoryData.allocationsTimestamps,
       frames: memoryData.frames,
       counts: memoryData.counts
     });
 
-    resolve();
+    deferred.resolve();
   }),
 
   toString: () => "[object MemoryFrontFacade]"
 };
 
 // Bind all the methods that directly proxy to the actor
-MEMORY_ACTOR_METHODS.forEach(method => MemoryFrontFacade.prototype[method] = actorCompatibilityBridge(method));
+MEMORY_ACTOR_METHODS.forEach(method => MemoryFrontFacade.prototype[method] = CompatUtils.actorCompatibilityBridge(method));
 exports.MemoryFront = MemoryFrontFacade;
--- a/browser/devtools/performance/modules/logic/compatibility.js
+++ b/browser/devtools/performance/modules/logic/compatibility.js
@@ -1,15 +1,16 @@
 /* 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 { Task } = require("resource://gre/modules/Task.jsm");
-const { Promise } = require("resource://gre/modules/Promise.jsm");
+
+loader.lazyRequireGetter(this, "promise");
 loader.lazyRequireGetter(this, "EventEmitter",
   "devtools/toolkit/event-emitter");
 
 /**
  * A dummy front decorated with the provided methods.
  *
  * @param array blueprint
  *        A list of [funcName, retVal] describing the class.
@@ -108,46 +109,46 @@ exports.timelineActorSupported = Task.as
 /**
  * Returns a promise resolving to the location of the profiler actor
  * within this context.
  *
  * @param {TabTarget} target
  * @return {Promise<ProfilerActor>}
  */
 function getProfiler (target) {
-  let { promise, resolve } = Promise.defer();
+  let deferred = promise.defer();
   // Chrome and content process targets already have obtained a reference
   // to the profiler tab actor. Use it immediately.
   if (target.form && target.form.profilerActor) {
-    resolve(target.form.profilerActor);
+    deferred.resolve(target.form.profilerActor);
   }
   // Check if we already have a grip to the `listTabs` response object
   // and, if we do, use it to get to the profiler actor.
   else if (target.root && target.root.profilerActor) {
-    resolve(target.root.profilerActor);
+    deferred.resolve(target.root.profilerActor);
   }
   // Otherwise, call `listTabs`.
   else {
-    target.client.listTabs(({ profilerActor }) => resolve(profilerActor));
+    target.client.listTabs(({ profilerActor }) => deferred.resolve(profilerActor));
   }
-  return promise;
+  return deferred.promise;
 }
 exports.getProfiler = Task.async(getProfiler);
 
 /**
  * Makes a request to an actor that does not have the modern `Front`
  * interface.
  */
 function legacyRequest (target, actor, method, args) {
-  let { promise, resolve } = Promise.defer();
+  let deferred = promise.defer();
   let data = args[0] || {};
   data.to = actor;
   data.type = method;
-  target.client.request(data, resolve);
-  return promise;
+  target.client.request(data, deferred.resolve);
+  return deferred.promise;
 }
 
 /**
  * Returns a function to be used as a method on an "Actor" in ./actors.
  * Calls the underlying actor's method, supporting the modern `Front`
  * interface if possible, otherwise, falling back to using
  * `legacyRequest`.
  */
--- a/browser/devtools/performance/modules/logic/frame-utils.js
+++ b/browser/devtools/performance/modules/logic/frame-utils.js
@@ -1,18 +1,18 @@
 /* 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 { Ci } = require("chrome");
-const { extend } = require("sdk/util/object");
+const { Cc, Ci, Cu, Cr } = require("chrome");
+
 loader.lazyRequireGetter(this, "Services");
 loader.lazyRequireGetter(this, "CATEGORY_OTHER",
-  "devtools/shared/profiler/global", true);
+  "devtools/performance/global", true);
 
 // Character codes used in various parsing helper functions.
 const CHAR_CODE_A = "a".charCodeAt(0);
 const CHAR_CODE_C = "c".charCodeAt(0);
 const CHAR_CODE_E = "e".charCodeAt(0);
 const CHAR_CODE_F = "f".charCodeAt(0);
 const CHAR_CODE_H = "h".charCodeAt(0);
 const CHAR_CODE_I = "i".charCodeAt(0);
--- a/browser/devtools/performance/modules/logic/front.js
+++ b/browser/devtools/performance/modules/logic/front.js
@@ -1,30 +1,32 @@
 /* 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 { Cc, Ci, Cu, Cr } = require("chrome");
 const { Task } = require("resource://gre/modules/Task.jsm");
-const { extend } = require("sdk/util/object");
-const { RecordingModel } = require("devtools/performance/recording-model");
 
 loader.lazyRequireGetter(this, "Services");
+loader.lazyRequireGetter(this, "promise");
 loader.lazyRequireGetter(this, "EventEmitter",
   "devtools/toolkit/event-emitter");
+loader.lazyRequireGetter(this, "extend",
+  "sdk/util/object", true);
+
+loader.lazyRequireGetter(this, "Actors",
+  "devtools/performance/actors");
+loader.lazyRequireGetter(this, "RecordingModel",
+  "devtools/performance/recording-model", true);
 loader.lazyRequireGetter(this, "DevToolsUtils",
   "devtools/toolkit/DevToolsUtils");
-loader.lazyRequireGetter(this, "actors",
-  "devtools/performance/actors");
 
 loader.lazyImporter(this, "gDevTools",
   "resource:///modules/devtools/gDevTools.jsm");
-loader.lazyImporter(this, "Promise",
-  "resource://gre/modules/Promise.jsm");
 
 // Events to pipe from PerformanceActorsConnection to the PerformanceFront
 const CONNECTION_PIPE_EVENTS = [
   "timeline-data", "profiler-already-active", "profiler-activated",
   "recording-starting", "recording-started", "recording-stopping", "recording-stopped",
   "profiler-status"
 ];
 
@@ -97,17 +99,17 @@ PerformanceActorsConnection.prototype = 
    */
   open: Task.async(function*() {
     if (this._connecting) {
       return this._connecting.promise;
     }
 
     // Create a promise that gets resolved upon connecting, so that
     // other attempts to open the connection use the same resolution promise
-    this._connecting = Promise.defer();
+    this._connecting = promise.defer();
 
     // Local debugging needs to make the target remote.
     yield this._target.makeRemote();
 
     // Sets `this._profiler`, `this._timeline` and `this._memory`.
     // Only initialize the timeline and memory fronts if the respective actors
     // are available. Older Gecko versions don't have existing implementations,
     // in which case all the methods we need can be easily mocked.
@@ -138,21 +140,21 @@ PerformanceActorsConnection.prototype = 
     this._connecting = null;
   }),
 
   /**
    * Initializes fronts and connects to the underlying actors using the facades
    * found in ./actors.js.
    */
   _connectActors: Task.async(function*() {
-    this._profiler = new actors.ProfilerFront(this._target);
-    this._memory = new actors.MemoryFront(this._target);
-    this._timeline = new actors.TimelineFront(this._target);
+    this._profiler = new Actors.ProfilerFront(this._target);
+    this._memory = new Actors.MemoryFront(this._target);
+    this._timeline = new Actors.TimelineFront(this._target);
 
-    yield Promise.all([
+    yield promise.all([
       this._profiler.connect(),
       this._memory.connect(),
       this._timeline.connect()
     ]);
 
     // Expose server support status of underlying actors
     // after connecting.
     this._memorySupported = !this._memory.IS_MOCK;
@@ -187,17 +189,17 @@ PerformanceActorsConnection.prototype = 
     this._profiler.off("profiler-activated", this._pipeToConnection);
     this._profiler.off("profiler-status", this._onProfilerStatus);
   },
 
   /**
    * Closes the connections to non-profiler actors.
    */
   _disconnectActors: Task.async(function* () {
-    yield Promise.all([
+    yield promise.all([
       this._profiler.destroy(),
       this._timeline.destroy(),
       this._memory.destroy()
     ]);
   }),
 
   /**
    * Invoked whenever `console.profile` is called.
--- a/browser/devtools/performance/modules/logic/marker-utils.js
+++ b/browser/devtools/performance/modules/logic/marker-utils.js
@@ -4,19 +4,19 @@
 "use strict";
 
 /**
  * This file contains utilities for creating elements for markers to be displayed,
  * and parsing out the blueprint to generate correct values for markers.
  */
 
 loader.lazyRequireGetter(this, "L10N",
-  "devtools/shared/timeline/global", true);
+  "devtools/performance/global", true);
 loader.lazyRequireGetter(this, "TIMELINE_BLUEPRINT",
-  "devtools/shared/timeline/global", true);
+  "devtools/performance/global", true);
 loader.lazyRequireGetter(this, "WebConsoleUtils",
   "devtools/toolkit/webconsole/utils");
 
 /**
  * Returns the correct label to display for passed in marker, based
  * off of the blueprints.
  *
  * @param {ProfileTimelineMarker} marker
--- a/browser/devtools/performance/modules/logic/recording-model.js
+++ b/browser/devtools/performance/modules/logic/recording-model.js
@@ -11,17 +11,16 @@ loader.lazyRequireGetter(this, "Performa
 loader.lazyRequireGetter(this, "RecordingUtils",
   "devtools/performance/recording-utils", true);
 
 /**
  * Model for a wholistic profile, containing the duration, profiling data,
  * frames data, timeline (marker, tick, memory) data, and methods to mark
  * a recording as 'in progress' or 'finished'.
  */
-
 const RecordingModel = function (options={}) {
   this._label = options.label || "";
   this._console = options.console || false;
 
   this._configuration = {
     withMarkers: options.withMarkers || false,
     withTicks: options.withTicks || false,
     withMemory: options.withMemory || false,
--- a/browser/devtools/performance/modules/logic/tree-model.js
+++ b/browser/devtools/performance/modules/logic/tree-model.js
@@ -1,29 +1,29 @@
 /* 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 {Cc, Ci, Cu, Cr} = require("chrome");
+const { Cc, Ci, Cu, Cr } = require("chrome");
 
 loader.lazyRequireGetter(this, "L10N",
-  "devtools/shared/profiler/global", true);
+  "devtools/performance/global", true);
 loader.lazyRequireGetter(this, "CATEGORY_MAPPINGS",
-  "devtools/shared/profiler/global", true);
+  "devtools/performance/global", true);
 loader.lazyRequireGetter(this, "CATEGORIES",
-  "devtools/shared/profiler/global", true);
+  "devtools/performance/global", true);
 loader.lazyRequireGetter(this, "CATEGORY_JIT",
-  "devtools/shared/profiler/global", true);
+  "devtools/performance/global", true);
 loader.lazyRequireGetter(this, "CATEGORY_OTHER",
-  "devtools/shared/profiler/global", true);
+  "devtools/performance/global", true);
 loader.lazyRequireGetter(this, "JITOptimizations",
-  "devtools/shared/profiler/jit", true);
+  "devtools/performance/jit", true);
 loader.lazyRequireGetter(this, "FrameUtils",
-  "devtools/shared/profiler/frame-utils");
+  "devtools/performance/frame-utils");
 
 exports.ThreadNode = ThreadNode;
 exports.FrameNode = FrameNode;
 exports.FrameNode.isContent = FrameUtils.isContent;
 
 /**
  * A call tree for a thread. This is essentially a linkage between all frames
  * of all samples into a single tree structure, with additional information
--- a/browser/devtools/performance/modules/widgets/graphs.js
+++ b/browser/devtools/performance/modules/widgets/graphs.js
@@ -2,35 +2,38 @@
  * 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";
 
 /**
  * This file contains the base line graph that all Performance line graphs use.
  */
 
-const {Cc, Ci, Cu, Cr} = require("chrome");
-
-Cu.import("resource:///modules/devtools/Graphs.jsm");
-Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
+const { Cc, Ci, Cu, Cr } = require("chrome");
+const { Task } = require("resource://gre/modules/Task.jsm");
+const { LineGraphWidget } = require("resource:///modules/devtools/Graphs.jsm");
+const { BarGraphWidget } = require("resource:///modules/devtools/Graphs.jsm");
+const { CanvasGraphUtils } = require("resource:///modules/devtools/Graphs.jsm");
+const { Heritage } = require("resource:///modules/devtools/ViewHelpers.jsm");
 
-const { colorUtils: { setAlpha }} = require("devtools/css-color");
-const { getColor } = require("devtools/shared/theme");
-
-loader.lazyRequireGetter(this, "ProfilerGlobal",
-  "devtools/shared/profiler/global");
-loader.lazyRequireGetter(this, "TimelineGlobal",
-  "devtools/shared/timeline/global");
-loader.lazyRequireGetter(this, "MarkersOverview",
-  "devtools/shared/timeline/markers-overview", true);
+loader.lazyRequireGetter(this, "promise");
 loader.lazyRequireGetter(this, "EventEmitter",
   "devtools/toolkit/event-emitter");
 
+loader.lazyRequireGetter(this, "colorUtils",
+  "devtools/css-color", true);
+loader.lazyRequireGetter(this, "getColor",
+  "devtools/shared/theme", true);
+loader.lazyRequireGetter(this, "ProfilerGlobal",
+  "devtools/performance/global");
+loader.lazyRequireGetter(this, "TimelineGlobal",
+  "devtools/performance/global");
+loader.lazyRequireGetter(this, "MarkersOverview",
+  "devtools/performance/markers-overview", true);
+
 /**
  * For line graphs
  */
 const HEIGHT = 35; // px
 const STROKE_WIDTH = 1; // px
 const DAMPEN_VALUES = 0.95;
 const CLIPHEAD_LINE_COLOR = "#666";
 const SELECTION_LINE_COLOR = "#555";
@@ -81,23 +84,23 @@ PerformanceGraph.prototype = Heritage.ex
    * and updates the internal styling to match. Requires a redraw
    * to see the effects.
    */
   setTheme: function (theme) {
     theme = theme || "light";
     let mainColor = getColor(this.mainColor || "highlight-blue", theme);
     this.backgroundColor = getColor("body-background", theme);
     this.strokeColor = mainColor;
-    this.backgroundGradientStart = setAlpha(mainColor, 0.2);
-    this.backgroundGradientEnd = setAlpha(mainColor, 0.2);
-    this.selectionBackgroundColor = setAlpha(getColor(SELECTION_BACKGROUND_COLOR_NAME, theme), 0.25);
+    this.backgroundGradientStart = colorUtils.setAlpha(mainColor, 0.2);
+    this.backgroundGradientEnd = colorUtils.setAlpha(mainColor, 0.2);
+    this.selectionBackgroundColor = colorUtils.setAlpha(getColor(SELECTION_BACKGROUND_COLOR_NAME, theme), 0.25);
     this.selectionStripesColor = "rgba(255, 255, 255, 0.1)";
-    this.maximumLineColor = setAlpha(mainColor, 0.4);
-    this.averageLineColor = setAlpha(mainColor, 0.7);
-    this.minimumLineColor = setAlpha(mainColor, 0.9);
+    this.maximumLineColor = colorUtils.setAlpha(mainColor, 0.4);
+    this.averageLineColor = colorUtils.setAlpha(mainColor, 0.7);
+    this.minimumLineColor = colorUtils.setAlpha(mainColor, 0.9);
   }
 });
 
 /**
  * Constructor for the framerate graph. Inherits from PerformanceGraph.
  *
  * @param nsIDOMNode parent
  *        The parent node holding the overview.
@@ -212,17 +215,17 @@ GraphsController.prototype = {
     yield (this._rendering && this._rendering.promise);
 
     // Check after yielding to ensure we're not tearing down,
     // as this can create a race condition in tests
     if (this._destroyed) {
       return;
     }
 
-    this._rendering = Promise.defer();
+    this._rendering = promise.defer();
     for (let graph of (yield this._getEnabled())) {
       yield graph.setPerformanceData(recordingData, resolution);
       this.emit("rendered", graph.graphName);
     }
     this._rendering.resolve();
   }),
 
   /**
--- a/browser/devtools/performance/modules/widgets/marker-details.js
+++ b/browser/devtools/performance/modules/widgets/marker-details.js
@@ -2,24 +2,27 @@
  * 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";
 
 /**
  * This file contains the rendering code for the marker sidebar.
  */
 
-loader.lazyRequireGetter(this, "L10N",
-  "devtools/shared/timeline/global", true);
-loader.lazyRequireGetter(this, "TIMELINE_BLUEPRINT",
-  "devtools/shared/timeline/global", true);
+const { Cc, Ci, Cu, Cr } = require("chrome");
+
 loader.lazyRequireGetter(this, "EventEmitter",
   "devtools/toolkit/event-emitter");
+
+loader.lazyRequireGetter(this, "L10N",
+  "devtools/performance/global", true);
+loader.lazyRequireGetter(this, "TIMELINE_BLUEPRINT",
+  "devtools/performance/global", true);
 loader.lazyRequireGetter(this, "MarkerUtils",
-  "devtools/shared/timeline/marker-utils");
+  "devtools/performance/marker-utils");
 
 /**
  * A detailed view for one single marker.
  *
  * @param nsIDOMNode parent
  *        The parent node holding the view.
  * @param nsIDOMNode splitter
  *        The splitter node that the resize event is bound to.
--- a/browser/devtools/performance/modules/widgets/markers-overview.js
+++ b/browser/devtools/performance/modules/widgets/markers-overview.js
@@ -4,26 +4,26 @@
 "use strict";
 
 /**
  * This file contains the "markers overview" graph, which is a minimap of all
  * the timeline data. Regions inside it may be selected, determining which
  * markers are visible in the "waterfall".
  */
 
-const {Cc, Ci, Cu, Cr} = require("chrome");
-
-Cu.import("resource:///modules/devtools/Graphs.jsm");
-Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
+const { Cc, Ci, Cu, Cr } = require("chrome");
+const { AbstractCanvasGraph } = require("resource:///modules/devtools/Graphs.jsm");
+const { Heritage } = require("resource:///modules/devtools/ViewHelpers.jsm");
 
-const { colorUtils: { setAlpha }} = require("devtools/css-color");
-const { getColor } = require("devtools/shared/theme");
-
+loader.lazyRequireGetter(this, "colorUtils",
+  "devtools/css-color", true);
+loader.lazyRequireGetter(this, "getColor",
+  "devtools/shared/theme", true);
 loader.lazyRequireGetter(this, "L10N",
-  "devtools/shared/timeline/global", true);
+  "devtools/performance/global", true);
 
 const OVERVIEW_HEADER_HEIGHT = 14; // px
 const OVERVIEW_ROW_HEIGHT = 11; // px
 
 const OVERVIEW_SELECTION_LINE_COLOR = "#666";
 const OVERVIEW_CLIPHEAD_LINE_COLOR = "#555";
 
 const FIND_OPTIMAL_TICK_INTERVAL_MAX_ITERS = 100;
@@ -219,18 +219,18 @@ MarkersOverview.prototype = Heritage.ext
   /**
    * Sets the theme via `theme` to either "light" or "dark",
    * and updates the internal styling to match. Requires a redraw
    * to see the effects.
    */
   setTheme: function (theme) {
     this.theme = theme = theme || "light";
     this.backgroundColor = getColor("body-background", theme);
-    this.selectionBackgroundColor = setAlpha(getColor("selection-background", theme), 0.25);
-    this.selectionStripesColor = setAlpha("#fff", 0.1);
+    this.selectionBackgroundColor = colorUtils.setAlpha(getColor("selection-background", theme), 0.25);
+    this.selectionStripesColor = colorUtils.setAlpha("#fff", 0.1);
     this.headerBackgroundColor = getColor("body-background", theme);
     this.headerTextColor = getColor("body-color", theme);
-    this.headerTimelineStrokeColor = setAlpha(getColor("body-color-alt", theme), 0.25);
-    this.alternatingBackgroundColor = setAlpha(getColor("body-color", theme), 0.05);
+    this.headerTimelineStrokeColor = colorUtils.setAlpha(getColor("body-color-alt", theme), 0.25);
+    this.alternatingBackgroundColor = colorUtils.setAlpha(getColor("body-color", theme), 0.05);
   }
 });
 
 exports.MarkersOverview = MarkersOverview;
--- a/browser/devtools/performance/modules/widgets/tree-view.js
+++ b/browser/devtools/performance/modules/widgets/tree-view.js
@@ -1,32 +1,31 @@
 /* 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 {Cc, Ci, Cu, Cr} = require("chrome");
-
-loader.lazyRequireGetter(this, "L10N",
-  "devtools/shared/profiler/global", true);
+/**
+ * This file contains the tree view, displaying all the samples and frames
+ * received from the proviler in a tree-like structure.
+ */
 
-loader.lazyImporter(this, "Heritage",
-  "resource:///modules/devtools/ViewHelpers.jsm");
-loader.lazyImporter(this, "AbstractTreeItem",
-  "resource:///modules/devtools/AbstractTreeItem.jsm");
+const { Cc, Ci, Cu, Cr } = require("chrome");
+const { L10N } = require("devtools/performance/global");
+const { Heritage } = require("resource:///modules/devtools/ViewHelpers.jsm");
+const { AbstractTreeItem } = require("resource:///modules/devtools/AbstractTreeItem.jsm");
 
 const MILLISECOND_UNITS = L10N.getStr("table.ms");
 const PERCENTAGE_UNITS = L10N.getStr("table.percentage");
 const URL_LABEL_TOOLTIP = L10N.getStr("table.url.tooltiptext");
 const CALL_TREE_INDENTATION = 16; // px
 
 const DEFAULT_SORTING_PREDICATE = (frameA, frameB) => {
   let dataA = frameA.getDisplayedData();
   let dataB = frameB.getDisplayedData();
-
   return this.inverted
     ? (dataA.selfPercentage < dataB.selfPercentage ? 1 : -1)
     : (dataA.samples < dataB.samples ? 1 : -1);
 };
 
 const DEFAULT_AUTO_EXPAND_DEPTH = 3; // depth
 const DEFAULT_VISIBLE_CELLS = {
   duration: true,
--- a/browser/devtools/performance/modules/widgets/waterfall.js
+++ b/browser/devtools/performance/modules/widgets/waterfall.js
@@ -3,29 +3,31 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 /**
  * This file contains the "waterfall" view, essentially a detailed list
  * of all the markers in the timeline data.
  */
 
-const {Ci, Cu} = require("chrome");
+const { Cc, Ci, Cu, Cr } = require("chrome");
+
+loader.lazyRequireGetter(this, "promise");
+loader.lazyRequireGetter(this, "EventEmitter",
+  "devtools/toolkit/event-emitter");
 
 loader.lazyRequireGetter(this, "L10N",
-  "devtools/shared/timeline/global", true);
+  "devtools/performance/global", true);
+loader.lazyRequireGetter(this, "MarkerUtils",
+  "devtools/performance/marker-utils");
 
 loader.lazyImporter(this, "setNamedTimeout",
   "resource:///modules/devtools/ViewHelpers.jsm");
 loader.lazyImporter(this, "clearNamedTimeout",
   "resource:///modules/devtools/ViewHelpers.jsm");
-loader.lazyRequireGetter(this, "EventEmitter",
-  "devtools/toolkit/event-emitter");
-loader.lazyRequireGetter(this, "MarkerUtils",
-  "devtools/shared/timeline/marker-utils");
 
 const HTML_NS = "http://www.w3.org/1999/xhtml";
 
 const WATERFALL_SIDEBAR_WIDTH = 200; // px
 
 const WATERFALL_IMMEDIATE_DRAW_MARKERS_COUNT = 30;
 const WATERFALL_FLUSH_OUTSTANDING_MARKERS_DELAY = 75; // ms
 
--- a/browser/devtools/performance/panel.js
+++ b/browser/devtools/performance/panel.js
@@ -1,23 +1,23 @@
 /* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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 {Cc, Ci, Cu, Cr} = require("chrome");
-const { PerformanceFront } = require("devtools/performance/front");
-
-Cu.import("resource://gre/modules/Task.jsm");
+const { Cc, Ci, Cu, Cr } = require("chrome");
+const { Task } = require("resource://gre/modules/Task.jsm");
 
 loader.lazyRequireGetter(this, "promise");
 loader.lazyRequireGetter(this, "EventEmitter",
   "devtools/toolkit/event-emitter");
+loader.lazyRequireGetter(this, "PerformanceFront",
+  "devtools/performance/front", true);
 
 function PerformancePanel(iframeWindow, toolbox) {
   this.panelWin = iframeWindow;
   this._toolbox = toolbox;
 
   EventEmitter.decorate(this);
 }
 
--- a/browser/devtools/performance/performance-controller.js
+++ b/browser/devtools/performance/performance-controller.js
@@ -1,63 +1,68 @@
 /* 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 { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
+const { Task } = require("resource://gre/modules/Task.jsm");
+const { Heritage, ViewHelpers, WidgetMethods } = require("resource:///modules/devtools/ViewHelpers.jsm");
 
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/devtools/Loader.jsm");
-Cu.import("resource://gre/modules/devtools/Console.jsm");
-Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
-
-devtools.lazyRequireGetter(this, "Services");
-devtools.lazyRequireGetter(this, "promise");
-devtools.lazyRequireGetter(this, "EventEmitter",
+loader.lazyRequireGetter(this, "Services");
+loader.lazyRequireGetter(this, "promise");
+loader.lazyRequireGetter(this, "EventEmitter",
   "devtools/toolkit/event-emitter");
-devtools.lazyRequireGetter(this, "DevToolsUtils",
+loader.lazyRequireGetter(this, "DevToolsUtils",
   "devtools/toolkit/DevToolsUtils");
 
-devtools.lazyRequireGetter(this, "TreeWidget",
-  "devtools/shared/widgets/TreeWidget", true);
-devtools.lazyRequireGetter(this, "TIMELINE_BLUEPRINT",
-  "devtools/shared/timeline/global", true);
-devtools.lazyRequireGetter(this, "L10N",
-  "devtools/shared/profiler/global", true);
-devtools.lazyRequireGetter(this, "RecordingUtils",
+// Logic modules
+
+loader.lazyRequireGetter(this, "L10N",
+  "devtools/performance/global", true);
+loader.lazyRequireGetter(this, "TIMELINE_BLUEPRINT",
+  "devtools/performance/global", true);
+loader.lazyRequireGetter(this, "RecordingUtils",
   "devtools/performance/recording-utils", true);
-devtools.lazyRequireGetter(this, "RecordingModel",
+loader.lazyRequireGetter(this, "RecordingModel",
   "devtools/performance/recording-model", true);
-devtools.lazyRequireGetter(this, "GraphsController",
+loader.lazyRequireGetter(this, "GraphsController",
   "devtools/performance/graphs", true);
-devtools.lazyRequireGetter(this, "Waterfall",
-  "devtools/shared/timeline/waterfall", true);
-devtools.lazyRequireGetter(this, "MarkerDetails",
-  "devtools/shared/timeline/marker-details", true);
-devtools.lazyRequireGetter(this, "MarkerUtils",
-  "devtools/shared/timeline/marker-utils");
-devtools.lazyRequireGetter(this, "CallView",
-  "devtools/shared/profiler/tree-view", true);
-devtools.lazyRequireGetter(this, "ThreadNode",
-  "devtools/shared/profiler/tree-model", true);
-devtools.lazyRequireGetter(this, "FrameNode",
-  "devtools/shared/profiler/tree-model", true);
-devtools.lazyRequireGetter(this, "JITOptimizations",
-  "devtools/shared/profiler/jit", true);
-devtools.lazyRequireGetter(this, "OptionsView",
+loader.lazyRequireGetter(this, "Waterfall",
+  "devtools/performance/waterfall", true);
+loader.lazyRequireGetter(this, "MarkerDetails",
+  "devtools/performance/marker-details", true);
+loader.lazyRequireGetter(this, "MarkerUtils",
+  "devtools/performance/marker-utils");
+loader.lazyRequireGetter(this, "CallView",
+  "devtools/performance/tree-view", true);
+loader.lazyRequireGetter(this, "ThreadNode",
+  "devtools/performance/tree-model", true);
+loader.lazyRequireGetter(this, "FrameNode",
+  "devtools/performance/tree-model", true);
+loader.lazyRequireGetter(this, "JITOptimizations",
+  "devtools/performance/jit", true);
+
+// Widgets modules
+
+loader.lazyRequireGetter(this, "OptionsView",
   "devtools/shared/options-view", true);
-devtools.lazyRequireGetter(this, "FlameGraphUtils",
+loader.lazyRequireGetter(this, "FlameGraphUtils",
   "devtools/shared/widgets/FlameGraph", true);
-devtools.lazyRequireGetter(this, "FlameGraph",
+loader.lazyRequireGetter(this, "FlameGraph",
   "devtools/shared/widgets/FlameGraph", true);
+loader.lazyRequireGetter(this, "TreeWidget",
+  "devtools/shared/widgets/TreeWidget", true);
 
-devtools.lazyImporter(this, "SideMenuWidget",
+loader.lazyImporter(this, "SideMenuWidget",
   "resource:///modules/devtools/SideMenuWidget.jsm");
-devtools.lazyImporter(this, "PluralForm",
+loader.lazyImporter(this, "setNamedTimeout",
+  "resource:///modules/devtools/ViewHelpers.jsm");
+loader.lazyImporter(this, "clearNamedTimeout",
+  "resource:///modules/devtools/ViewHelpers.jsm");
+loader.lazyImporter(this, "PluralForm",
   "resource://gre/modules/PluralForm.jsm");
 
 const BRANCH_NAME = "devtools.performance.ui.";
 
 // Events emitted by various objects in the panel.
 const EVENTS = {
   // Fired by the PerformanceController and OptionsView when a pref changes.
   PREF_CHANGED: "Performance:PrefChanged",
@@ -307,17 +312,16 @@ let PerformanceController = {
   }),
 
   /**
    * Stops recording with the PerformanceFront. Emits `EVENTS.RECORDING_STOPPED`
    * when the front has stopped recording.
    */
   stopRecording: Task.async(function *() {
     let recording = this.getLatestManualRecording();
-
     yield gFront.stopRecording(recording);
   }),
 
   /**
    * Saves the given recording to a file. Emits `EVENTS.RECORDING_EXPORTED`
    * when the file was saved.
    *
    * @param RecordingModel recording
@@ -331,17 +335,16 @@ let PerformanceController = {
   }),
 
   /**
    * Clears all recordings from the list as well as the current recording.
    * Emits `EVENTS.RECORDINGS_CLEARED` when complete so other components can clean up.
    */
   clearRecordings: Task.async(function* () {
     let latest = this.getLatestManualRecording();
-
     if (latest && latest.isRecording()) {
       yield this.stopRecording();
     }
     // If last recording is not recording, but finalizing itself,
     // wait for that to finish
     if (latest && !latest.isCompleted()) {
       yield this.once(EVENTS.RECORDING_STOPPED);
     }
--- a/browser/devtools/performance/performance-view.js
+++ b/browser/devtools/performance/performance-view.js
@@ -4,16 +4,17 @@
 "use strict";
 
 /**
  * Master view handler for the performance tool.
  */
 let PerformanceView = {
 
   _state: null,
+
   // Set to true if the front emits a "buffer-status" event, indicating
   // that the server has support for determining buffer status.
   _bufferStatusSupported: false,
 
   // Mapping of state to selectors for different panes
   // of the main profiler view. Used in `PerformanceView.setState()`
   states: {
     empty: [
--- a/browser/devtools/performance/system.js
+++ b/browser/devtools/performance/system.js
@@ -3,14 +3,18 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 /**
  * A dump file to attach preprocessing directives consumable to the controller
  * without littering our code with directives.
  */
 
+const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
+const { devtools: loader } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
+const require = loader.require;
+
 const SYSTEM = {};
 
 // If e10s is possible on the platform.
 #ifdef E10S_TESTING_ONLY
 SYSTEM.MULTIPROCESS_SUPPORTED = true;
 #endif
--- a/browser/devtools/performance/test/browser_marker-utils.js
+++ b/browser/devtools/performance/test/browser_marker-utils.js
@@ -1,18 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests the marker utils methods.
  */
 
 function spawnTest () {
-  let { TIMELINE_BLUEPRINT } = devtools.require("devtools/shared/timeline/global");
-  let Utils = devtools.require("devtools/shared/timeline/marker-utils");
+  let { TIMELINE_BLUEPRINT } = devtools.require("devtools/performance/global");
+  let Utils = devtools.require("devtools/performance/marker-utils");
 
   Services.prefs.setBoolPref(PLATFORM_DATA_PREF, false);
 
   is(Utils.getMarkerLabel({ name: "DOMEvent" }), "DOM Event",
     "getMarkerLabel() returns a simple label");
   is(Utils.getMarkerLabel({ name: "Javascript", causeName: "setTimeout handler" }), "setTimeout",
     "getMarkerLabel() returns a label defined via function");
 
--- a/browser/devtools/performance/test/browser_perf-events-calltree.js
+++ b/browser/devtools/performance/test/browser_perf-events-calltree.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests that the call tree up/down events work for js calltree and memory calltree.
  */
-const { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+const { ThreadNode } = devtools.require("devtools/performance/tree-model");
 const { RecordingUtils } = devtools.require("devtools/performance/recording-utils")
 function spawnTest () {
   let focus = 0;
   let focusEvent = () => focus++;
 
   Services.prefs.setBoolPref(MEMORY_PREF, true);
 
   let { panel } = yield initPerformance(SIMPLE_URL);
--- a/browser/devtools/performance/test/browser_perf-jit-model-01.js
+++ b/browser/devtools/performance/test/browser_perf-jit-model-01.js
@@ -5,17 +5,17 @@
  * Tests that JITOptimizations track optimization sites and create
  * an OptimizationSiteProfile when adding optimization sites, like from the
  * FrameNode, and the returning of that data is as expected.
  */
 
 const { RecordingUtils } = devtools.require("devtools/performance/recording-utils");
 
 function test() {
-  let { JITOptimizations } = devtools.require("devtools/shared/profiler/jit");
+  let { JITOptimizations } = devtools.require("devtools/performance/jit");
 
   let rawSites = [];
   rawSites.push(gRawSite2);
   rawSites.push(gRawSite2);
   rawSites.push(gRawSite1);
   rawSites.push(gRawSite1);
   rawSites.push(gRawSite2);
   rawSites.push(gRawSite3);
--- a/browser/devtools/performance/test/browser_perf-jit-model-02.js
+++ b/browser/devtools/performance/test/browser_perf-jit-model-02.js
@@ -4,17 +4,17 @@
 /**
  * Tests that JITOptimizations create OptimizationSites, and the underlying
  * OptimizationSites methods work as expected.
  */
 
 const { RecordingUtils } = devtools.require("devtools/performance/recording-utils");
 
 function test() {
-  let { JITOptimizations, OptimizationSite } = devtools.require("devtools/shared/profiler/jit");
+  let { JITOptimizations, OptimizationSite } = devtools.require("devtools/performance/jit");
 
   let rawSites = [];
   rawSites.push(gRawSite2);
   rawSites.push(gRawSite2);
   rawSites.push(gRawSite1);
   rawSites.push(gRawSite1);
   rawSites.push(gRawSite2);
   rawSites.push(gRawSite3);
--- a/browser/devtools/performance/test/browser_perf-jit-view-02.js
+++ b/browser/devtools/performance/test/browser_perf-jit-view-02.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests that the JIT Optimizations view does not display information
  * for meta nodes when viewing "content only".
  */
 
-const { CATEGORY_MASK } = devtools.require("devtools/shared/profiler/global");
+const { CATEGORY_MASK } = devtools.require("devtools/performance/global");
 const { RecordingUtils } = devtools.require("devtools/performance/recording-utils");
 
 Services.prefs.setBoolPref(INVERT_PREF, false);
 Services.prefs.setBoolPref(PLATFORM_DATA_PREF, false);
 
 function spawnTest () {
   let { panel } = yield initPerformance(SIMPLE_URL);
   let { EVENTS, $, $$, window, PerformanceController } = panel.panelWin;
--- a/browser/devtools/performance/test/browser_profiler-frame-utils-01.js
+++ b/browser/devtools/performance/test/browser_profiler-frame-utils-01.js
@@ -31,17 +31,17 @@ const CHROME_LOCATIONS = [
   { location: "chrome://browser/content/content.js", line: 456, column: 123 },
   "setTimeout_timer (resource://gre/foo.js:123:434)",
   "hello/<.world (jar:file://Users/mcurie/Dev/jetpacks.js)",
   "hello/<.world (resource://foo.js -> http://bar/baz.js:123:987)",
   "EnterJIT",
 ].map(argify);
 
 function test() {
-  const { isContent, parseLocation } = devtools.require("devtools/shared/profiler/frame-utils");
+  const { isContent, parseLocation } = devtools.require("devtools/performance/frame-utils");
 
   for (let frame of CONTENT_LOCATIONS) {
     ok(isContent.apply(null, frameify(frame)), `${frame[0]} should be considered a content frame.`);
   }
 
   for (let frame of CHROME_LOCATIONS) {
     ok(!isContent.apply(null, frameify(frame)), `${frame[0]} should not be considered a content frame.`);
   }
--- a/browser/devtools/performance/test/browser_profiler_categories.js
+++ b/browser/devtools/performance/test/browser_profiler_categories.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if the profiler categories are mapped correctly.
  */
 
 function test() {
-  let global = devtools.require("devtools/shared/profiler/global");
+  let global = devtools.require("devtools/performance/global");
   let l10n = global.L10N;
   let categories = global.CATEGORIES;
   let mappings = global.CATEGORY_MAPPINGS;
   let count = categories.length;
 
   ok(count,
     "Should have a non-empty list of categories available.");
 
--- a/browser/devtools/performance/test/browser_profiler_content-check.js
+++ b/browser/devtools/performance/test/browser_profiler_content-check.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests the function testing whether or not a frame is content or chrome
  * works properly.
  */
 
 function test() {
-  let { FrameNode } = devtools.require("devtools/shared/profiler/tree-model");
+  let { FrameNode } = devtools.require("devtools/performance/tree-model");
 
   ok(FrameNode.isContent({ location: "http://foo" }),
     "Verifying content/chrome frames is working properly.");
   ok(FrameNode.isContent({ location: "https://foo" }),
     "Verifying content/chrome frames is working properly.");
   ok(FrameNode.isContent({ location: "file://foo" }),
     "Verifying content/chrome frames is working properly.");
 
--- a/browser/devtools/performance/test/browser_profiler_tree-frame-node.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-frame-node.js
@@ -1,18 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Verifies if FrameNodes retain and parse their data appropriately.
  */
 
 function test() {
-  let { FrameNode } = devtools.require("devtools/shared/profiler/tree-model");
-  let { CATEGORY_OTHER } = devtools.require("devtools/shared/profiler/global");
+  let { FrameNode } = devtools.require("devtools/performance/tree-model");
+  let { CATEGORY_OTHER } = devtools.require("devtools/performance/global");
 
   let frame1 = new FrameNode("hello/<.world (http://foo/bar.js:123:987)", {
     location: "hello/<.world (http://foo/bar.js:123:987)",
     line: 456,
     isContent: FrameNode.isContent({
       location: "hello/<.world (http://foo/bar.js:123:987)"
     })
   }, false);
--- a/browser/devtools/performance/test/browser_profiler_tree-model-01.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-model-01.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if a call tree model can be correctly computed from a samples array.
  */
 
 function test() {
-  const { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+  const { ThreadNode } = devtools.require("devtools/performance/tree-model");
 
   // Create a root node from a given samples array.
 
   let threadNode = new ThreadNode(gThread);
   let root = getFrameNodePath(threadNode, "(root)");
 
   // Test the root node.
 
--- a/browser/devtools/performance/test/browser_profiler_tree-model-02.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-model-02.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if a call tree model ignores samples with no timing information.
  */
 
 function test() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
 
   // Create a root node from a given samples array.
 
   let root = getFrameNodePath(new ThreadNode(gThread), "(root)");
 
   // Test the root node.
 
   is(root.duration, 5,
--- a/browser/devtools/performance/test/browser_profiler_tree-model-03.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-model-03.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if a call tree model can be correctly computed from a samples array,
  * while at the same time filtering by duration.
  */
 
 function test() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
 
   // Create a root node from a given samples array, filtering by time.
   //
   // Filtering from 5 to 18 includes the 2nd and 3rd samples. The 2nd sample
   // starts exactly on 5 and ends at 11. The 3rd sample starts at 11 and ends
   // exactly at 18.
   let startTime = 5;
   let endTime = 18;
--- a/browser/devtools/performance/test/browser_profiler_tree-model-04.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-model-04.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if a call tree model can be correctly computed from a samples array,
  * while at the same time filtering by duration and content-only frames.
  */
 
 function test() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
 
   // Create a root node from a given samples array, filtering by time.
 
   let startTime = 5;
   let endTime = 18;
   let root = getFrameNodePath(new ThreadNode(gThread, { startTime: startTime, endTime: endTime, contentOnly: true }), "(root)");
 
   // Test the root node.
--- a/browser/devtools/performance/test/browser_profiler_tree-model-05.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-model-05.js
@@ -38,17 +38,17 @@ let gThread = synthesizeProfileForTest([
     { location: "(root)" },
     { location: "A" },
     { location: "B" },
     { location: "F" }
   ]
 }]);
 
 function test() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
 
   let root = new ThreadNode(gThread, { invertTree: true });
 
   is(root.calls.length, 2,
      "Should get the 2 youngest frames, not the 1 oldest frame");
 
   let C = getFrameNodePath(root, "C");
   ok(C, "Should have C as a child of the root.");
--- a/browser/devtools/performance/test/browser_profiler_tree-model-06.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-model-06.js
@@ -150,17 +150,17 @@ gThread.frameTable.data.forEach((frame) 
   case "E_O3":
     frame[LOCATION_SLOT] = uniqStr("E");
     frame[OPTIMIZATIONS_SLOT] = gRawSite3;
     break;
   }
 });
 
 function test() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
 
   let root = new ThreadNode(gThread);
 
   let A = getFrameNodePath(root, "(root) > A");
 
   let opts = A.getOptimizations();
   let sites = opts.optimizationSites;
   is(sites.length, 2, "Frame A has two optimization sites.");
--- a/browser/devtools/performance/test/browser_profiler_tree-model-07.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-model-07.js
@@ -1,19 +1,19 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests that when displaying only content nodes, platform nodes are generalized.
  */
 
-let { CATEGORY_MASK } = devtools.require("devtools/shared/profiler/global");
+let { CATEGORY_MASK } = devtools.require("devtools/performance/global");
 
 function test() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
   let url = (n) => `http://content/${n}`;
 
   // Create a root node from a given samples array.
 
   let root = getFrameNodePath(new ThreadNode(gThread, { contentOnly: true }), "(root)");
 
   /*
    * should have a tree like:
--- a/browser/devtools/performance/test/browser_profiler_tree-view-01.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-01.js
@@ -2,18 +2,18 @@
    http://foo/bar/creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if the profiler's tree view implementation works properly and
  * creates the correct column structure.
  */
 
 function test() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
-  let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
+  let { CallView } = devtools.require("devtools/performance/tree-view");
 
   let threadNode = new ThreadNode(gThread);
   // Don't display the synthesized (root) and the real (root) node twice.
   threadNode.calls = threadNode.calls[0].calls;
   let treeRoot = new CallView({ frame: threadNode });
 
   let container = document.createElement("vbox");
   treeRoot.autoExpandDepth = 0;
--- a/browser/devtools/performance/test/browser_profiler_tree-view-02.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-02.js
@@ -1,21 +1,21 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if the profiler's tree view implementation works properly and
  * creates the correct column structure after expanding some of the nodes.
  */
 
-let { CATEGORY_MASK } = devtools.require("devtools/shared/profiler/global");
+let { CATEGORY_MASK } = devtools.require("devtools/performance/global");
 
 function test() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
-  let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
+  let { CallView } = devtools.require("devtools/performance/tree-view");
 
   let threadNode = new ThreadNode(gThread);
   // Don't display the synthesized (root) and the real (root) node twice.
   threadNode.calls = threadNode.calls[0].calls;
   let treeRoot = new CallView({ frame: threadNode });
 
   let container = document.createElement("vbox");
   treeRoot.autoExpandDepth = 0;
--- a/browser/devtools/performance/test/browser_profiler_tree-view-03.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-03.js
@@ -2,18 +2,18 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if the profiler's tree view implementation works properly and
  * creates the correct column structure and can auto-expand all nodes.
  */
 
 function test() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
-  let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
+  let { CallView } = devtools.require("devtools/performance/tree-view");
 
   let threadNode = new ThreadNode(gThread);
   // Don't display the synthesized (root) and the real (root) node twice.
   threadNode.calls = threadNode.calls[0].calls;
   let treeRoot = new CallView({ frame: threadNode });
 
   let container = document.createElement("vbox");
   treeRoot.attachTo(container);
--- a/browser/devtools/performance/test/browser_profiler_tree-view-04.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-04.js
@@ -1,21 +1,21 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if the profiler's tree view implementation works properly and
  * creates the correct DOM nodes in the correct order.
  */
 
-let { CATEGORY_MASK } = devtools.require("devtools/shared/profiler/global");
+let { CATEGORY_MASK } = devtools.require("devtools/performance/global");
 
 function test() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
-  let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
+  let { CallView } = devtools.require("devtools/performance/tree-view");
 
   let threadNode = new ThreadNode(gThread);
   // Don't display the synthesized (root) and the real (root) node twice.
   threadNode.calls = threadNode.calls[0].calls;
   let treeRoot = new CallView({ frame: threadNode });
 
   let container = document.createElement("vbox");
   treeRoot.attachTo(container);
--- a/browser/devtools/performance/test/browser_profiler_tree-view-05.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-05.js
@@ -2,18 +2,18 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if the profiler's tree view implementation works properly and
  * can toggle categories hidden or visible.
  */
 
 function test() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
-  let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
+  let { CallView } = devtools.require("devtools/performance/tree-view");
 
   let threadNode = new ThreadNode(gThread);
   // Don't display the synthesized (root) and the real (root) node twice.
   threadNode.calls = threadNode.calls[0].calls;
   let treeRoot = new CallView({ frame: threadNode });
 
   let container = document.createElement("vbox");
   treeRoot.attachTo(container);
--- a/browser/devtools/performance/test/browser_profiler_tree-view-06.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-06.js
@@ -2,18 +2,18 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if the profiler's tree view implementation works properly and
  * correctly emits events when certain DOM nodes are clicked.
  */
 
 function spawnTest () {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
-  let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
+  let { CallView } = devtools.require("devtools/performance/tree-view");
 
   let threadNode = new ThreadNode(gThread);
   // Don't display the synthesized (root) and the real (root) node twice.
   threadNode.calls = threadNode.calls[0].calls;
   let treeRoot = new CallView({ frame: threadNode });
 
   let container = document.createElement("vbox");
   treeRoot.attachTo(container);
--- a/browser/devtools/performance/test/browser_profiler_tree-view-07.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-07.js
@@ -2,18 +2,18 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if the profiler's tree view implementation works properly and
  * has the correct 'root', 'parent', 'level' etc. accessors on child nodes.
  */
 
 function spawnTest () {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
-  let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
+  let { CallView } = devtools.require("devtools/performance/tree-view");
 
   let threadNode = new ThreadNode(gThread);
   // Don't display the synthesized (root) and the real (root) node twice.
   threadNode.calls = threadNode.calls[0].calls;
   let treeRoot = new CallView({ frame: threadNode });
 
   let container = document.createElement("vbox");
   container.id = "call-tree-container";
--- a/browser/devtools/performance/test/browser_profiler_tree-view-08.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-08.js
@@ -1,21 +1,21 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests that the profiler's tree view renders generalized platform data
  * when `contentOnly` is on correctly.
  */
 
-let { CATEGORY_MASK } = devtools.require("devtools/shared/profiler/global");
+let { CATEGORY_MASK } = devtools.require("devtools/performance/global");
 
 function test() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
-  let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
+  let { CallView } = devtools.require("devtools/performance/tree-view");
 
   /*
    * should have a tree like:
    * root
    *   - A
    *     - B
    *       - C
    *       - D
--- a/browser/devtools/performance/test/browser_profiler_tree-view-09.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-09.js
@@ -1,21 +1,21 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests that the profiler's tree view sorts inverted call trees by
  * "self cost" and not "total cost".
  */
 
-let { CATEGORY_MASK } = devtools.require("devtools/shared/profiler/global");
+let { CATEGORY_MASK } = devtools.require("devtools/performance/global");
 
 let test = Task.async(function*() {
-  let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
-  let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
+  let { ThreadNode } = devtools.require("devtools/performance/tree-model");
+  let { CallView } = devtools.require("devtools/performance/tree-view");
 
   let threadNode = new ThreadNode(gSamples, { invertTree: true });
   let treeRoot = new CallView({ frame: threadNode, inverted: true, autoExpandDepth: 1 });
 
   let container = document.createElement("vbox");
   treeRoot.attachTo(container);
 
   is(treeRoot.getChild(0).frame.location, "B",
--- a/browser/devtools/performance/test/browser_timeline-blueprint.js
+++ b/browser/devtools/performance/test/browser_timeline-blueprint.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if the timeline blueprint has a correct structure.
  */
 
 function spawnTest () {
-  let { TIMELINE_BLUEPRINT } = devtools.require("devtools/shared/timeline/global");
+  let { TIMELINE_BLUEPRINT } = devtools.require("devtools/performance/global");
 
   ok(TIMELINE_BLUEPRINT,
     "A timeline blueprint should be available.");
 
   ok(Object.keys(TIMELINE_BLUEPRINT).length,
     "The timeline blueprint has at least one entry.");
 
   for (let [key, value] of Iterator(TIMELINE_BLUEPRINT)) {
--- a/browser/devtools/performance/test/browser_timeline-waterfall-sidebar.js
+++ b/browser/devtools/performance/test/browser_timeline-waterfall-sidebar.js
@@ -3,18 +3,18 @@
 
 /**
  * Tests if the sidebar is properly updated when a marker is selected.
  */
 
 function spawnTest () {
   let { target, panel } = yield initPerformance(SIMPLE_URL);
   let { $, $$, EVENTS, PerformanceController, OverviewView } = panel.panelWin;
-  let { L10N, TIMELINE_BLUEPRINT } = devtools.require("devtools/shared/timeline/global");
-  let { getMarkerLabel } = devtools.require("devtools/shared/timeline/marker-utils");
+  let { L10N, TIMELINE_BLUEPRINT } = devtools.require("devtools/performance/global");
+  let { getMarkerLabel } = devtools.require("devtools/performance/marker-utils");
 
   yield startRecording(panel);
   ok(true, "Recording has started.");
 
   yield waitUntil(() => {
     // Wait until we get 3 different markers.
     let markers = PerformanceController.getCurrentRecording().getMarkers();
     return markers.some(m => m.name == "Styles") &&
--- a/browser/devtools/performance/views/details-js-call-tree.js
+++ b/browser/devtools/performance/views/details-js-call-tree.js
@@ -21,17 +21,16 @@ let JsCallTreeView = Heritage.extend(Det
    */
   initialize: function () {
     DetailsSubview.initialize.call(this);
 
     this._onPrefChanged = this._onPrefChanged.bind(this);
     this._onLink = this._onLink.bind(this);
 
     this.container = $("#js-calltree-view .call-tree-cells-container");
-
     JITOptimizationsView.initialize();
   },
 
   /**
    * Unbinds events.
    */
   destroy: function () {
     this.container = null;
--- a/browser/devtools/shared/test/browser_flame-graph-utils-03.js
+++ b/browser/devtools/shared/test/browser_flame-graph-utils-03.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests if platform frames are removed from the flame graph data.
 
 let {FlameGraphUtils} = devtools.require("devtools/shared/widgets/FlameGraph");
 let {PALLETTE_SIZE} = devtools.require("devtools/shared/widgets/FlameGraph");
-let {FrameNode} = devtools.require("devtools/shared/profiler/tree-model");
+let {FrameNode} = devtools.require("devtools/performance/tree-model");
 
 add_task(function*() {
   yield promiseTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
--- a/browser/devtools/shared/test/browser_flame-graph-utils-04.js
+++ b/browser/devtools/shared/test/browser_flame-graph-utils-04.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests if (idle) nodes are added when necessary in the flame graph data.
 
 let {FlameGraphUtils} = devtools.require("devtools/shared/widgets/FlameGraph");
 let {PALLETTE_SIZE} = devtools.require("devtools/shared/widgets/FlameGraph");
-let {FrameNode} = devtools.require("devtools/shared/profiler/tree-model");
+let {FrameNode} = devtools.require("devtools/performance/tree-model");
 
 add_task(function*() {
   yield promiseTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
--- a/browser/devtools/shared/widgets/FlameGraph.js
+++ b/browser/devtools/shared/widgets/FlameGraph.js
@@ -4,20 +4,20 @@
 "use strict";
 
 const { ViewHelpers } = require("resource:///modules/devtools/ViewHelpers.jsm");
 const { AbstractCanvasGraph, GraphArea, GraphAreaDragger } = require("resource:///modules/devtools/Graphs.jsm");
 const { Promise } = require("resource://gre/modules/Promise.jsm");
 const { Task } = require("resource://gre/modules/Task.jsm");
 const { getColor } = require("devtools/shared/theme");
 const EventEmitter = require("devtools/toolkit/event-emitter");
-const FrameUtils = require("devtools/shared/profiler/frame-utils");
+const FrameUtils = require("devtools/performance/frame-utils");
 
 loader.lazyRequireGetter(this, "CATEGORY_MAPPINGS",
-  "devtools/shared/profiler/global", true);
+  "devtools/performance/global", true);
 
 const HTML_NS = "http://www.w3.org/1999/xhtml";
 const GRAPH_SRC = "chrome://browser/content/devtools/graphs-frame.xhtml";
 const L10N = new ViewHelpers.L10N();
 
 const GRAPH_RESIZE_EVENTS_DRAIN = 100; // ms
 
 const GRAPH_WHEEL_ZOOM_SENSITIVITY = 0.00035;