commit fe9016075612070249a70edd5f9bb06570318c33
parent e088da1ad9e21512a456549e9de205c666e092df
Author: Nazım Can Altınova <canaltinova@gmail.com>
Date: Tue, 21 Oct 2025 21:15:37 +0000
Bug 1916785 - Register the JS sources for the browser tab r=mstange,profiler-reviewers
Now that we return `jsSources` inside `additionalInformation`, we save
it inside the WeakMap that we keep per tabs.
Differential Revision: https://phabricator.services.mozilla.com/D259271
Diffstat:
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/devtools/client/performance-new/@types/perf.d.ts b/devtools/client/performance-new/@types/perf.d.ts
@@ -604,6 +604,10 @@ export class ProfilerWebChannel {
) => void;
}
+type JSSources = Partial<{
+ [sourceUuid: string]: string;
+}>;
+
/**
* The per-tab information that is stored when a new profile is captured
* and a profiler tab is opened, to serve the correct profile to the tab
@@ -612,6 +616,7 @@ export class ProfilerWebChannel {
export type ProfilerBrowserInfo = {
profileCaptureResult: ProfileCaptureResult;
symbolicationService: SymbolicationService | null;
+ jsSources: JSSources | null;
};
export type ProfileCaptureResult =
diff --git a/devtools/client/performance-new/panel/initializer.js b/devtools/client/performance-new/panel/initializer.js
@@ -151,7 +151,12 @@ async function gInit(perfFront, traits, pageContext, openAboutProfiling) {
type: "ERROR",
error: typeof error === "string" ? new Error(error) : error,
};
- registerProfileCaptureForBrowser(browser, profileCaptureResult, null);
+ registerProfileCaptureForBrowser(
+ browser,
+ profileCaptureResult,
+ null,
+ null
+ );
return;
}
@@ -176,7 +181,8 @@ async function gInit(perfFront, traits, pageContext, openAboutProfiling) {
registerProfileCaptureForBrowser(
browser,
profileCaptureResult,
- symbolicationService
+ symbolicationService,
+ additionalInformation?.jsSources ?? null
);
};
diff --git a/devtools/client/performance-new/shared/background.sys.mjs b/devtools/client/performance-new/shared/background.sys.mjs
@@ -25,6 +25,7 @@ import { createLazyLoaders } from "resource://devtools/client/performance-new/sh
* @typedef {import("../@types/perf").ProfilerBrowserInfo} ProfilerBrowserInfo
* @typedef {import("../@types/perf").ProfileCaptureResult} ProfileCaptureResult
* @typedef {import("../@types/perf").ProfilerFaviconData} ProfilerFaviconData
+ * @typedef {import("../@types/perf").JSSources} JSSources
*/
/** @type {PerformancePref["PopupFeatureFlag"]} */
@@ -127,7 +128,8 @@ export async function captureProfile(pageContext) {
registerProfileCaptureForBrowser(
browser,
profileCaptureResult,
- symbolicationService
+ symbolicationService,
+ additionalInformation?.jsSources ?? null
);
}
@@ -442,15 +444,18 @@ export async function handleWebChannelMessage(channel, id, message, target) {
* when profiler.firefox.com sends GET_SYMBOL_TABLE WebChannel messages to us. This
* method should obtain a symbol table for the requested binary and resolve the
* returned promise with it.
+ * @param {JSSources | null} jsSources - JS sources from the profile collection.
*/
export function registerProfileCaptureForBrowser(
browser,
profileCaptureResult,
- symbolicationService
+ symbolicationService,
+ jsSources
) {
infoForBrowserMap.set(browser, {
profileCaptureResult,
symbolicationService,
+ jsSources,
});
}