summaryrefslogtreecommitdiffstats
path: root/devtools/client/performance/initializer.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /devtools/client/performance/initializer.js
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/performance/initializer.js')
-rw-r--r--devtools/client/performance/initializer.js80
1 files changed, 80 insertions, 0 deletions
diff --git a/devtools/client/performance/initializer.js b/devtools/client/performance/initializer.js
new file mode 100644
index 0000000000..6623be5157
--- /dev/null
+++ b/devtools/client/performance/initializer.js
@@ -0,0 +1,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 { BrowserLoader } = ChromeUtils.import(
+ "resource://devtools/client/shared/browser-loader.js"
+);
+const { require } = BrowserLoader({
+ baseURI: "resource://devtools/client/performance/",
+ window: window,
+});
+
+const {
+ PerformanceController,
+} = require("devtools/client/performance/performance-controller");
+const {
+ PerformanceView,
+} = require("devtools/client/performance/performance-view");
+const { DetailsView } = require("devtools/client/performance/views/details");
+const {
+ DetailsSubview,
+} = require("devtools/client/performance/views/details-abstract-subview");
+const {
+ JsCallTreeView,
+} = require("devtools/client/performance/views/details-js-call-tree");
+const {
+ JsFlameGraphView,
+} = require("devtools/client/performance/views/details-js-flamegraph");
+const {
+ MemoryCallTreeView,
+} = require("devtools/client/performance/views/details-memory-call-tree");
+const {
+ MemoryFlameGraphView,
+} = require("devtools/client/performance/views/details-memory-flamegraph");
+const { OverviewView } = require("devtools/client/performance/views/overview");
+const {
+ RecordingsView,
+} = require("devtools/client/performance/views/recordings");
+const { ToolbarView } = require("devtools/client/performance/views/toolbar");
+const {
+ WaterfallView,
+} = require("devtools/client/performance/views/details-waterfall");
+
+const EVENTS = require("devtools/client/performance/events");
+
+/**
+ * The performance panel used to only share modules through references on the window
+ * object. We started cleaning this up and to require() explicitly in Bug 1524982, but
+ * some modules and tests are still relying on those references so we keep exposing them
+ * for the moment. Bug 1528777.
+ */
+window.PerformanceController = PerformanceController;
+window.PerformanceView = PerformanceView;
+window.DetailsView = DetailsView;
+window.DetailsSubview = DetailsSubview;
+window.JsCallTreeView = JsCallTreeView;
+window.JsFlameGraphView = JsFlameGraphView;
+window.MemoryCallTreeView = MemoryCallTreeView;
+window.MemoryFlameGraphView = MemoryFlameGraphView;
+window.OverviewView = OverviewView;
+window.RecordingsView = RecordingsView;
+window.ToolbarView = ToolbarView;
+window.WaterfallView = WaterfallView;
+
+window.EVENTS = EVENTS;
+
+/**
+ * DOM query helpers.
+ */
+/* exported $, $$ */
+function $(selector, target = document) {
+ return target.querySelector(selector);
+}
+window.$ = $;
+function $$(selector, target = document) {
+ return target.querySelectorAll(selector);
+}
+window.$$ = $$;