tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 5599774de8c4db1b22ceb89b948ae2f6a9939788
parent 38c7e07c4038f481f7ad45c6349e96ac16d4a04b
Author: Nazım Can Altınova <canaltinova@gmail.com>
Date:   Tue, 21 Oct 2025 23:59:09 +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:
Mdevtools/client/performance-new/@types/perf.d.ts | 5+++++
Mdevtools/client/performance-new/panel/initializer.js | 10++++++++--
Mdevtools/client/performance-new/shared/background.sys.mjs | 9+++++++--
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, }); }