Bug 1639739: Add Fission decision status to about:support. r=nika,fluent-reviewers,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D92981
This commit is contained in:
@@ -119,20 +119,20 @@ var snapshotFormatters = {
|
|||||||
);
|
);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
let statusTextId = "multi-process-status-unknown";
|
const STATUS_STRINGS = {
|
||||||
|
experimentControl: "fission-status-experiment-control",
|
||||||
|
experimentTreatment: "fission-status-experiment-treatment",
|
||||||
|
disabledByE10sEnv: "fission-status-disabled-by-e10s-env",
|
||||||
|
enabledByEnv: "fission-status-enabled-by-env",
|
||||||
|
disabledBySafeMode: "fission-status-disabled-by-safe-mode",
|
||||||
|
enabledByDefault: "fission-status-enabled-by-default",
|
||||||
|
disabledByDefault: "fission-status-disabled-by-default",
|
||||||
|
enabledByUserPref: "fission-status-enabled-by-user-pref",
|
||||||
|
disabledByUserPref: "fission-status-disabled-by-user-pref",
|
||||||
|
disabledByE10sOther: "fission-status-disabled-by-e10s-other",
|
||||||
|
};
|
||||||
|
|
||||||
// Whitelist of known values with string descriptions:
|
let statusTextId = STATUS_STRINGS[data.fissionDecisionStatus];
|
||||||
switch (data.autoStartStatus) {
|
|
||||||
case 0:
|
|
||||||
case 1:
|
|
||||||
case 2:
|
|
||||||
case 4:
|
|
||||||
case 6:
|
|
||||||
case 7:
|
|
||||||
case 8:
|
|
||||||
statusTextId = "multi-process-status-" + data.autoStartStatus;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
document.l10n.setAttributes(
|
document.l10n.setAttributes(
|
||||||
$("multiprocess-box-process-count"),
|
$("multiprocess-box-process-count"),
|
||||||
@@ -142,7 +142,15 @@ var snapshotFormatters = {
|
|||||||
totalWindows: data.numTotalWindows,
|
totalWindows: data.numTotalWindows,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
document.l10n.setAttributes($("multiprocess-box-status"), statusTextId);
|
document.l10n.setAttributes(
|
||||||
|
$("fission-box-process-count"),
|
||||||
|
"fission-windows",
|
||||||
|
{
|
||||||
|
fissionWindows: data.numFissionWindows,
|
||||||
|
totalWindows: data.numTotalWindows,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
document.l10n.setAttributes($("fission-box-status"), statusTextId);
|
||||||
|
|
||||||
if (Services.policies) {
|
if (Services.policies) {
|
||||||
let policiesStrId = "";
|
let policiesStrId = "";
|
||||||
|
|||||||
@@ -205,7 +205,15 @@
|
|||||||
|
|
||||||
<td id="multiprocess-box">
|
<td id="multiprocess-box">
|
||||||
<span id="multiprocess-box-process-count"/>
|
<span id="multiprocess-box-process-count"/>
|
||||||
<span id="multiprocess-box-status"/>
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th class="column" data-l10n-id="app-basics-fission-support"/>
|
||||||
|
|
||||||
|
<td id="fission-box">
|
||||||
|
<span id="fission-box-process-count"/>
|
||||||
|
<span id="fission-box-status"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ app-basics-service-workers = Registered Service Workers
|
|||||||
app-basics-profiles = Profiles
|
app-basics-profiles = Profiles
|
||||||
app-basics-launcher-process-status = Launcher Process
|
app-basics-launcher-process-status = Launcher Process
|
||||||
app-basics-multi-process-support = Multiprocess Windows
|
app-basics-multi-process-support = Multiprocess Windows
|
||||||
|
app-basics-fission-support = Fission Windows
|
||||||
app-basics-remote-processes-count = Remote Processes
|
app-basics-remote-processes-count = Remote Processes
|
||||||
app-basics-enterprise-policies = Enterprise Policies
|
app-basics-enterprise-policies = Enterprise Policies
|
||||||
app-basics-location-service-key-google = Google Location Service Key
|
app-basics-location-service-key-google = Google Location Service Key
|
||||||
@@ -326,14 +327,20 @@ launcher-process-status-unknown = Unknown status
|
|||||||
# $remoteWindows (integer) - Number of remote windows
|
# $remoteWindows (integer) - Number of remote windows
|
||||||
# $totalWindows (integer) - Number of total windows
|
# $totalWindows (integer) - Number of total windows
|
||||||
multi-process-windows = { $remoteWindows }/{ $totalWindows }
|
multi-process-windows = { $remoteWindows }/{ $totalWindows }
|
||||||
multi-process-status-0 = Enabled by user
|
# Variables
|
||||||
multi-process-status-1 = Enabled by default
|
# $fissionWindows (integer) - Number of remote windows
|
||||||
multi-process-status-2 = Disabled
|
# $totalWindows (integer) - Number of total windows
|
||||||
multi-process-status-4 = Disabled by accessibility tools
|
fission-windows = { $fissionWindows }/{ $totalWindows }
|
||||||
multi-process-status-6 = Disabled by unsupported text input
|
fission-status-experiment-control = Disabled by experiment
|
||||||
multi-process-status-7 = Disabled by add-ons
|
fission-status-experiment-treatment = Enabled by experiment
|
||||||
multi-process-status-8 = Disabled forcibly
|
fission-status-disabled-by-e10s-env = Disabled by environment
|
||||||
multi-process-status-unknown = Unknown status
|
fission-status-enabled-by-env = Enabled by environment
|
||||||
|
fission-status-disabled-by-safe-mode = Disabled by safe mode
|
||||||
|
fission-status-enabled-by-default = Enabled by default
|
||||||
|
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
|
||||||
|
|
||||||
async-pan-zoom = Asynchronous Pan/Zoom
|
async-pan-zoom = Asynchronous Pan/Zoom
|
||||||
apz-none = none
|
apz-none = none
|
||||||
|
|||||||
@@ -228,11 +228,15 @@ var dataProviders = {
|
|||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
data.numTotalWindows = 0;
|
data.numTotalWindows = 0;
|
||||||
|
data.numFissionWindows = 0;
|
||||||
data.numRemoteWindows = 0;
|
data.numRemoteWindows = 0;
|
||||||
for (let { docShell } of Services.wm.getEnumerator("navigator:browser")) {
|
for (let { docShell } of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
|
docShell.QueryInterface(Ci.nsILoadContext);
|
||||||
data.numTotalWindows++;
|
data.numTotalWindows++;
|
||||||
let remote = docShell.QueryInterface(Ci.nsILoadContext).useRemoteTabs;
|
if (docShell.useRemoteSubframes) {
|
||||||
if (remote) {
|
data.numFissionWindows++;
|
||||||
|
}
|
||||||
|
if (docShell.useRemoteTabs) {
|
||||||
data.numRemoteWindows++;
|
data.numRemoteWindows++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -246,17 +250,6 @@ var dataProviders = {
|
|||||||
|
|
||||||
data.remoteAutoStart = Services.appinfo.browserTabsRemoteAutostart;
|
data.remoteAutoStart = Services.appinfo.browserTabsRemoteAutostart;
|
||||||
|
|
||||||
try {
|
|
||||||
let e10sStatus = Cc["@mozilla.org/supports-PRUint64;1"].createInstance(
|
|
||||||
Ci.nsISupportsPRUint64
|
|
||||||
);
|
|
||||||
let appinfo = Services.appinfo.QueryInterface(Ci.nsIObserver);
|
|
||||||
appinfo.observe(e10sStatus, "getE10SBlocked", "");
|
|
||||||
data.autoStartStatus = e10sStatus.data;
|
|
||||||
} catch (e) {
|
|
||||||
data.autoStartStatus = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Services.policies) {
|
if (Services.policies) {
|
||||||
data.policiesStatus = Services.policies.status;
|
data.policiesStatus = Services.policies.status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,9 +196,6 @@ const SNAPSHOT_SCHEMA = {
|
|||||||
type: "boolean",
|
type: "boolean",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
autoStartStatus: {
|
|
||||||
type: "number",
|
|
||||||
},
|
|
||||||
fissionAutoStart: {
|
fissionAutoStart: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
},
|
},
|
||||||
@@ -208,6 +205,9 @@ const SNAPSHOT_SCHEMA = {
|
|||||||
numTotalWindows: {
|
numTotalWindows: {
|
||||||
type: "number",
|
type: "number",
|
||||||
},
|
},
|
||||||
|
numFissionWindows: {
|
||||||
|
type: "number",
|
||||||
|
},
|
||||||
numRemoteWindows: {
|
numRemoteWindows: {
|
||||||
type: "number",
|
type: "number",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -502,26 +502,16 @@ static bool gFissionAutostart = false;
|
|||||||
static bool gFissionAutostartInitialized = false;
|
static bool gFissionAutostartInitialized = false;
|
||||||
static nsIXULRuntime::FissionDecisionStatus gFissionDecisionStatus;
|
static nsIXULRuntime::FissionDecisionStatus gFissionDecisionStatus;
|
||||||
|
|
||||||
static bool gBrowserTabsRemoteAutostart = false;
|
enum E10sStatus {
|
||||||
static uint64_t gBrowserTabsRemoteStatus = 0;
|
kE10sEnabledByDefault,
|
||||||
static bool gBrowserTabsRemoteAutostartInitialized = false;
|
kE10sDisabledByUser,
|
||||||
|
kE10sForceDisabled,
|
||||||
// TODO: Remove this when fissionDecisionStatus is exposed in about:support.
|
|
||||||
// If you add anything to this enum, please update about:support to reflect it
|
|
||||||
enum {
|
|
||||||
// kE10sEnabledByUser = 0, removed when ending non-e10s support
|
|
||||||
kE10sEnabledByDefault = 1,
|
|
||||||
kE10sDisabledByUser = 2,
|
|
||||||
// kE10sDisabledInSafeMode = 3, was removed in bug 1172491.
|
|
||||||
// kE10sDisabledForAccessibility = 4,
|
|
||||||
// kE10sDisabledForMacGfx = 5, was removed in bug 1068674.
|
|
||||||
// kE10sDisabledForBidi = 6, removed in bug 1309599
|
|
||||||
// kE10sDisabledForAddons = 7, removed in bug 1406212
|
|
||||||
kE10sForceDisabled = 8,
|
|
||||||
// kE10sDisabledForXPAcceleration = 9, removed in bug 1296353
|
|
||||||
// kE10sDisabledForOperatingSystem = 10, removed due to xp-eol
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static bool gBrowserTabsRemoteAutostart = false;
|
||||||
|
static E10sStatus gBrowserTabsRemoteStatus;
|
||||||
|
static bool gBrowserTabsRemoteAutostartInitialized = false;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
bool BrowserTabsRemoteAutostart() {
|
bool BrowserTabsRemoteAutostart() {
|
||||||
@@ -542,7 +532,7 @@ bool BrowserTabsRemoteAutostart() {
|
|||||||
bool allowSingleProcessOutsideAutomation = true;
|
bool allowSingleProcessOutsideAutomation = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int status = kE10sEnabledByDefault;
|
E10sStatus status = kE10sEnabledByDefault;
|
||||||
// We use "are non-local connections disabled" as a proxy for
|
// We use "are non-local connections disabled" as a proxy for
|
||||||
// "are we running some kind of automated test". It would be nicer to use
|
// "are we running some kind of automated test". It would be nicer to use
|
||||||
// xpc::IsInAutomation(), but that depends on some prefs being set, which
|
// xpc::IsInAutomation(), but that depends on some prefs being set, which
|
||||||
@@ -756,7 +746,6 @@ bool SessionHistoryInParent() {
|
|||||||
* singleton.
|
* singleton.
|
||||||
*/
|
*/
|
||||||
class nsXULAppInfo : public nsIXULAppInfo,
|
class nsXULAppInfo : public nsIXULAppInfo,
|
||||||
public nsIObserver,
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
public nsIWinAppHelper,
|
public nsIWinAppHelper,
|
||||||
#endif
|
#endif
|
||||||
@@ -771,7 +760,6 @@ class nsXULAppInfo : public nsIXULAppInfo,
|
|||||||
NS_DECL_NSIPLATFORMINFO
|
NS_DECL_NSIPLATFORMINFO
|
||||||
NS_DECL_NSIXULAPPINFO
|
NS_DECL_NSIXULAPPINFO
|
||||||
NS_DECL_NSIXULRUNTIME
|
NS_DECL_NSIXULRUNTIME
|
||||||
NS_DECL_NSIOBSERVER
|
|
||||||
NS_DECL_NSICRASHREPORTER
|
NS_DECL_NSICRASHREPORTER
|
||||||
NS_DECL_NSIFINISHDUMPINGCALLBACK
|
NS_DECL_NSIFINISHDUMPINGCALLBACK
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
@@ -782,7 +770,6 @@ class nsXULAppInfo : public nsIXULAppInfo,
|
|||||||
NS_INTERFACE_MAP_BEGIN(nsXULAppInfo)
|
NS_INTERFACE_MAP_BEGIN(nsXULAppInfo)
|
||||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIXULRuntime)
|
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIXULRuntime)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIXULRuntime)
|
NS_INTERFACE_MAP_ENTRY(nsIXULRuntime)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIObserver)
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIWinAppHelper)
|
NS_INTERFACE_MAP_ENTRY(nsIWinAppHelper)
|
||||||
#endif
|
#endif
|
||||||
@@ -1052,21 +1039,6 @@ nsXULAppInfo::GetLastAppBuildID(nsACString& aResult) {
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsXULAppInfo::Observe(nsISupports* aSubject, const char* aTopic,
|
|
||||||
const char16_t* aData) {
|
|
||||||
// TODO: Remove this when fissionDecisionStatus is exposed in about:support.
|
|
||||||
if (!nsCRT::strcmp(aTopic, "getE10SBlocked")) {
|
|
||||||
nsCOMPtr<nsISupportsPRUint64> ret = do_QueryInterface(aSubject);
|
|
||||||
if (!ret) return NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
ret->SetData(gBrowserTabsRemoteStatus);
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsXULAppInfo::GetFissionAutostart(bool* aResult) {
|
nsXULAppInfo::GetFissionAutostart(bool* aResult) {
|
||||||
*aResult = FissionAutostart();
|
*aResult = FissionAutostart();
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ interface nsIXULRuntime : nsISupports
|
|||||||
eExperimentStatusCount,
|
eExperimentStatusCount,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// NOTE: Please do not add new values to this enum without also updating the
|
||||||
|
// mapping in aboutSupport.js
|
||||||
cenum FissionDecisionStatus : 8 {
|
cenum FissionDecisionStatus : 8 {
|
||||||
eFissionStatusUnknown = 0,
|
eFissionStatusUnknown = 0,
|
||||||
// Fission is disabled because the user is in the control group of a
|
// Fission is disabled because the user is in the control group of a
|
||||||
|
|||||||
Reference in New Issue
Block a user