зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1619578 - Make the profiler WebChannel work on beta; r=canaltinova
The WebChannels were not being initialized on beta due to being initialized after the feature pref was checked. This patch changes it so that profiler.firefox.com will still have the WebChannel registered, and then if the menu button is enabled via the WebChannel, the feature flag is flipped. I did not include a test on this, as this is a temporary measure until we flip on the mechanism for all users. Differential Revision: https://phabricator.services.mozilla.com/D65199 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
86a449e7c4
Коммит
13b081a62d
|
@ -372,6 +372,12 @@ export interface PerformancePref {
|
|||
* time that you open it. After that, it is not displayed by default.
|
||||
*/
|
||||
PopupIntroDisplayed: "devtools.performance.popup.intro-displayed";
|
||||
/**
|
||||
* This preference is used outside of the performance-new type system
|
||||
* (in DevToolsStartup). It toggles the availability of the menu item
|
||||
* "Tools -> Web Developer -> Enable Profiler Toolbar Icon".
|
||||
*/
|
||||
PopupFeatureFlag: "devtools.performance.popup.feature-flag";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,6 +44,8 @@ const OBJDIRS_PREF = "devtools.performance.recording.objdirs";
|
|||
const DURATION_PREF = "devtools.performance.recording.duration";
|
||||
/** @type {PerformancePref["Preset"]} */
|
||||
const PRESET_PREF = "devtools.performance.recording.preset";
|
||||
/** @type {PerformancePref["PopupFeatureFlag"]} */
|
||||
const POPUP_FEATURE_FLAG_PREF = "devtools.performance.popup.feature-flag";
|
||||
|
||||
// The following utilities are lazily loaded as they are not needed when controlling the
|
||||
// global state of the profiler, and only are used during specific funcationality like
|
||||
|
@ -394,6 +396,7 @@ function revertRecordingPreferences() {
|
|||
Services.prefs.clearUserPref(THREADS_PREF);
|
||||
Services.prefs.clearUserPref(OBJDIRS_PREF);
|
||||
Services.prefs.clearUserPref(DURATION_PREF);
|
||||
Services.prefs.clearUserPref(POPUP_FEATURE_FLAG_PREF);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -499,6 +502,10 @@ function handleWebChannelMessage(channel, id, message, target) {
|
|||
"the profiler menu button"
|
||||
);
|
||||
}
|
||||
// The menu button toggle is only enabled on Nightly by default. Once the profiler
|
||||
// is turned on once, make sure that the menu button is also available.
|
||||
Services.prefs.setBoolPref(POPUP_FEATURE_FLAG_PREF, true);
|
||||
|
||||
ProfilerMenuButton.toggle(ownerDocument);
|
||||
}
|
||||
|
||||
|
|
|
@ -628,6 +628,11 @@ DevToolsStartup.prototype = {
|
|||
AppConstants.NIGHTLY_BUILD
|
||||
);
|
||||
|
||||
// Listen for messages from the front-end. This needs to happen even if the
|
||||
// button isn't enabled yet. This will allow the front-end to turn on the
|
||||
// popup for our users, regardless of if the feature is enabled by default.
|
||||
this.initializeProfilerWebChannel();
|
||||
|
||||
if (!isPopupFeatureFlagEnabled) {
|
||||
// The profiler's popup is experimental. The plan is to eventually turn it on
|
||||
// everywhere, but while it's under active development we don't want everyone
|
||||
|
@ -637,10 +642,6 @@ DevToolsStartup.prototype = {
|
|||
return;
|
||||
}
|
||||
|
||||
// Listen for messages from the front-end. This needs to happen even if the
|
||||
// button isn't enabled yet.
|
||||
this.initializeProfilerWebChannel();
|
||||
|
||||
if (isProfilerButtonEnabled()) {
|
||||
ProfilerMenuButton.initialize();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче