diff options
Diffstat (limited to 'devtools/client/performance-new/shared')
-rw-r--r-- | devtools/client/performance-new/shared/background.sys.mjs | 18 | ||||
-rw-r--r-- | devtools/client/performance-new/shared/browser.js | 6 |
2 files changed, 21 insertions, 3 deletions
diff --git a/devtools/client/performance-new/shared/background.sys.mjs b/devtools/client/performance-new/shared/background.sys.mjs index f538500a42..4b19f68b71 100644 --- a/devtools/client/performance-new/shared/background.sys.mjs +++ b/devtools/client/performance-new/shared/background.sys.mjs @@ -63,7 +63,7 @@ const PREF_PREFIX = "devtools.performance.recording."; // capabilities of the WebChannel. The front-end can handle old WebChannel // versions and has a full list of versions and capabilities here: // https://github.com/firefox-devtools/profiler/blob/main/src/app-logic/web-channel.js -const CURRENT_WEBCHANNEL_VERSION = 2; +const CURRENT_WEBCHANNEL_VERSION = 3; const lazyRequire = {}; // eslint-disable-next-line mozilla/lazy-getter-object-name @@ -761,7 +761,7 @@ async function getResponseForMessage(request, browser) { // Enable the profiler menu button. const { ProfilerMenuButton } = lazy.ProfilerMenuButton(); - ProfilerMenuButton.addToNavbar(ownerDocument); + ProfilerMenuButton.addToNavbar(); // Dispatch the change event manually, so that the shortcuts will also be // added. @@ -817,6 +817,20 @@ async function getResponseForMessage(request, browser) { } return []; } + case "GET_EXTERNAL_MARKERS": { + const { startTime, endTime } = request; + const externalMarkersUrl = Services.prefs.getCharPref( + "devtools.performance.recording.markers.external-url", + "" + ); + if (externalMarkersUrl) { + const response = await fetch( + `${externalMarkersUrl}?start=${startTime}&end=${endTime}` + ); + return response.json(); + } + return []; + } default: console.error( "An unknown message type was received by the profiler's WebChannel handler.", diff --git a/devtools/client/performance-new/shared/browser.js b/devtools/client/performance-new/shared/browser.js index c97bb0a0ab..34f641cc1b 100644 --- a/devtools/client/performance-new/shared/browser.js +++ b/devtools/client/performance-new/shared/browser.js @@ -153,7 +153,11 @@ function openFilePickerForObjdir(window, objdirs, changeObjdirs) { const FilePicker = Cc["@mozilla.org/filepicker;1"].createInstance( Ci.nsIFilePicker ); - FilePicker.init(window, "Pick build directory", FilePicker.modeGetFolder); + FilePicker.init( + window.browsingContext, + "Pick build directory", + FilePicker.modeGetFolder + ); FilePicker.open(rv => { if (rv == FilePicker.returnOK) { const path = FilePicker.file.path; |