From cd43e30d8b94a51db4e25de074aaf63915c009b6 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 22 Jun 2021 17:28:34 +0000 Subject: [PATCH] Bug 1714112: Add new Fission decision value for phased rollout enablement. r=nika,fluent-reviewers,flod This should be less confusing to users, and makes it easier to triage about:support data. Differential Revision: https://phabricator.services.mozilla.com/D118416 --- toolkit/content/aboutSupport.js | 1 + toolkit/locales/en-US/toolkit/about/aboutSupport.ftl | 1 + toolkit/xre/nsAppRunner.cpp | 12 ++++++++++-- xpcom/system/nsIXULRuntime.idl | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index 5d9ada219f06..9d62d8f043b3 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -149,6 +149,7 @@ var snapshotFormatters = { enabledByUserPref: "fission-status-enabled-by-user-pref", disabledByUserPref: "fission-status-disabled-by-user-pref", disabledByE10sOther: "fission-status-disabled-by-e10s-other", + enabledByRollout: "fission-status-enabled-by-rollout", }; let statusTextId = STATUS_STRINGS[data.fissionDecisionStatus]; diff --git a/toolkit/locales/en-US/toolkit/about/aboutSupport.ftl b/toolkit/locales/en-US/toolkit/about/aboutSupport.ftl index be0d9bc11f6a..a091a5325f07 100644 --- a/toolkit/locales/en-US/toolkit/about/aboutSupport.ftl +++ b/toolkit/locales/en-US/toolkit/about/aboutSupport.ftl @@ -378,6 +378,7 @@ fission-status-disabled-by-default = Disabled by default fission-status-enabled-by-user-pref = Enabled by user fission-status-disabled-by-user-pref = Disabled by user fission-status-disabled-by-e10s-other = E10s disabled +fission-status-enabled-by-rollout = Enabled by phased rollout async-pan-zoom = Asynchronous Pan/Zoom apz-none = none diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 3ec33c9b4541..ec04f9163947 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -585,7 +585,8 @@ bool BrowserTabsRemoteAutostart() { bool FissionExperimentEnrolled() { MOZ_ASSERT(XRE_IsParentProcess()); return gFissionExperimentStatus == nsIXULRuntime::eExperimentStatusControl || - gFissionExperimentStatus == nsIXULRuntime::eExperimentStatusTreatment; + gFissionExperimentStatus == nsIXULRuntime::eExperimentStatusTreatment || + gFissionExperimentStatus == nsIXULRuntime::eExperimentStatusRollout; } } // namespace mozilla @@ -683,7 +684,8 @@ static void EnsureFissionAutostartInitialized() { // enrollment status. if (FissionExperimentEnrolled()) { bool isTreatment = - gFissionExperimentStatus == nsIXULRuntime::eExperimentStatusTreatment; + gFissionExperimentStatus == nsIXULRuntime::eExperimentStatusTreatment || + gFissionExperimentStatus == nsIXULRuntime::eExperimentStatusRollout; Preferences::SetBool(kPrefFissionAutostart, isTreatment, PrefValueKind::Default); } @@ -710,6 +712,9 @@ static void EnsureFissionAutostartInitialized() { } else if (gFissionExperimentStatus == nsIXULRuntime::eExperimentStatusTreatment) { gFissionDecisionStatus = nsIXULRuntime::eFissionExperimentTreatment; + } else if (gFissionExperimentStatus == + nsIXULRuntime::eExperimentStatusRollout) { + gFissionDecisionStatus = nsIXULRuntime::eFissionEnabledByRollout; } else if (Preferences::HasUserValue(kPrefFissionAutostart)) { gFissionDecisionStatus = gFissionAutostart ? nsIXULRuntime::eFissionEnabledByUserPref @@ -1125,6 +1130,9 @@ nsXULAppInfo::GetFissionDecisionStatusString(nsACString& aResult) { case eFissionDisabledByE10sOther: aResult = "disabledByE10sOther"; break; + case eFissionEnabledByRollout: + aResult = "enabledByRollout"; + break; default: MOZ_ASSERT_UNREACHABLE("Unexpected enum value"); } diff --git a/xpcom/system/nsIXULRuntime.idl b/xpcom/system/nsIXULRuntime.idl index 375bf59390e2..2e04c2c5fbaf 100644 --- a/xpcom/system/nsIXULRuntime.idl +++ b/xpcom/system/nsIXULRuntime.idl @@ -66,6 +66,8 @@ interface nsIXULRuntime : nsISupports // The user was enrolled in the experiment, but became ineligible due to // manually modifying a relevant preference. eExperimentStatusDisqualified = 3, + // The user was selected for the phased Fission rollout. + eExperimentStatusRollout = 4, eExperimentStatusCount, }; @@ -103,6 +105,8 @@ interface nsIXULRuntime : nsISupports eFissionDisabledByUserPref = 9, // Fission is disabled because e10s is disabled for some other reason. eFissionDisabledByE10sOther = 10, + // Fission is enabled by a Normandy phased rollout. + eFissionEnabledByRollout = 11, }; /**