diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /browser/components/StartupRecorder.sys.mjs | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/StartupRecorder.sys.mjs')
-rw-r--r-- | browser/components/StartupRecorder.sys.mjs | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/browser/components/StartupRecorder.sys.mjs b/browser/components/StartupRecorder.sys.mjs index 7b69b52690..bdc08ee6dd 100644 --- a/browser/components/StartupRecorder.sys.mjs +++ b/browser/components/StartupRecorder.sys.mjs @@ -6,6 +6,23 @@ const Cm = Components.manager; Cm.QueryInterface(Ci.nsIServiceManager); import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs"; +import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; + +const lazy = {}; + +XPCOMUtils.defineLazyPreferenceGetter( + lazy, + "BROWSER_STARTUP_RECORD", + "browser.startup.record", + false +); + +XPCOMUtils.defineLazyPreferenceGetter( + lazy, + "BROWSER_STARTUP_RECORD_IMAGES", + "browser.startup.recordImages", + false +); let firstPaintNotification = "widget-first-paint"; // widget-first-paint fires much later than expected on Linux. @@ -98,10 +115,7 @@ StartupRecorder.prototype = { return; } - if ( - !Services.prefs.getBoolPref("browser.startup.record", false) && - !Services.prefs.getBoolPref("browser.startup.recordImages", false) - ) { + if (!lazy.BROWSER_STARTUP_RECORD && !lazy.BROWSER_STARTUP_RECORD_IMAGES) { this._resolve(); this._resolve = null; return; @@ -118,7 +132,7 @@ StartupRecorder.prototype = { "browser-startup-idle-tasks-finished", ]; - if (Services.prefs.getBoolPref("browser.startup.recordImages", false)) { + if (lazy.BROWSER_STARTUP_RECORD_IMAGES) { // For code simplicify, recording images excludes the other startup // recorder behaviors, so we can observe only the image topics. topics = [ @@ -180,7 +194,7 @@ StartupRecorder.prototype = { this.record.bind(this, "before handling user events") ); } else if (topic == "browser-startup-idle-tasks-finished") { - if (Services.prefs.getBoolPref("browser.startup.recordImages", false)) { + if (lazy.BROWSER_STARTUP_RECORD_IMAGES) { Services.obs.removeObserver(this, "image-drawing"); Services.obs.removeObserver(this, "image-loading"); this._resolve(); |