зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 4b1d470d9f98 (bug 1198459)
This commit is contained in:
Родитель
edd9dd84ec
Коммит
7265490919
|
@ -49,7 +49,6 @@
|
|||
#include "prprf.h"
|
||||
#include "prproces.h"
|
||||
#include "prenv.h"
|
||||
#include "prtime.h"
|
||||
|
||||
#include "nsIAppShellService.h"
|
||||
#include "nsIAppStartup.h"
|
||||
|
@ -4595,17 +4594,6 @@ enum {
|
|||
kE10sDisabledForMacGfx = 5,
|
||||
};
|
||||
|
||||
const char* kAccessibilityLastRunDatePref = "accessibility.lastLoadDate";
|
||||
const char* kAccessibilityLoadedLastSessionPref = "accessibility.loadedInLastSession";
|
||||
const char* kForceEnableE10sPref = "browser.tabs.remote.force-enable";
|
||||
|
||||
static inline uint32_t
|
||||
PRTimeToSeconds(PRTime t_usec)
|
||||
{
|
||||
PRTime usec_per_sec = PR_USEC_PER_SEC;
|
||||
return uint32_t(t_usec /= usec_per_sec);
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::BrowserTabsRemoteAutostart()
|
||||
{
|
||||
|
@ -4613,37 +4601,6 @@ mozilla::BrowserTabsRemoteAutostart()
|
|||
return gBrowserTabsRemoteAutostart;
|
||||
}
|
||||
gBrowserTabsRemoteAutostartInitialized = true;
|
||||
|
||||
bool disabledForA11y = false;
|
||||
#ifdef XP_WIN
|
||||
/**
|
||||
* Avoids enabling e10s if accessibility has recently loaded. Performs the
|
||||
* following checks:
|
||||
* 1) Checks a pref indicating if a11y loaded in the last session. This pref
|
||||
* is set in nsBrowserGlue.js. If a11y was loaded in the last session we
|
||||
* do not enable e10s in this session.
|
||||
* 2) Accessibility stores a last run date (PR_IntervalNow) when it is
|
||||
* initialized (see nsBaseWidget.cpp). We check if this pref exists and
|
||||
* compare it to now. If a11y hasn't run in an extended period of time or
|
||||
* if the date pref does not exist we load e10s.
|
||||
*/
|
||||
disabledForA11y = Preferences::GetBool(kAccessibilityLoadedLastSessionPref, false);
|
||||
if (!disabledForA11y &&
|
||||
Preferences::HasUserValue(kAccessibilityLastRunDatePref)) {
|
||||
#define ONE_WEEK_IN_SECONDS (60*60*24*7)
|
||||
uint32_t a11yRunDate = Preferences::GetInt(kAccessibilityLastRunDatePref, 0);
|
||||
MOZ_ASSERT(0 != a11yRunDate);
|
||||
// If a11y hasn't run for a period of time, clear the pref and load e10s
|
||||
uint32_t now = PRTimeToSeconds(PR_Now());
|
||||
uint32_t difference = now - a11yRunDate;
|
||||
if (difference > ONE_WEEK_IN_SECONDS || !a11yRunDate) {
|
||||
Preferences::ClearUser(kAccessibilityLastRunDatePref);
|
||||
} else {
|
||||
disabledForA11y = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool optInPref = Preferences::GetBool("browser.tabs.remote.autostart", false);
|
||||
bool trialPref = Preferences::GetBool("browser.tabs.remote.autostart.2", false);
|
||||
bool prefEnabled = optInPref || trialPref;
|
||||
|
@ -4666,13 +4623,15 @@ mozilla::BrowserTabsRemoteAutostart()
|
|||
gfxPrefs::GetSingleton().LayersOffMainThreadCompositionTestingEnabled();
|
||||
#endif
|
||||
|
||||
// Check for some conditions that might disable e10s.
|
||||
bool disabledForA11y = Preferences::GetBool("browser.tabs.remote.disabled-for-a11y", false);
|
||||
// Disable for VR
|
||||
bool disabledForVR = Preferences::GetBool("dom.vr.enabled", false);
|
||||
|
||||
if (e10sAllowed && prefEnabled) {
|
||||
if (disabledForA11y) {
|
||||
status = kE10sDisabledForAccessibility;
|
||||
LogE10sBlockedReason("An accessibility tool is or was active. See bug 1198459.");
|
||||
LogE10sBlockedReason("An accessibility tool is or was active. See bug 1115956.");
|
||||
} else if (disabledForVR) {
|
||||
LogE10sBlockedReason("Experimental VR interfaces are enabled");
|
||||
} else {
|
||||
|
@ -4719,11 +4678,6 @@ mozilla::BrowserTabsRemoteAutostart()
|
|||
}
|
||||
#endif // defined(XP_MACOSX)
|
||||
|
||||
// Uber override pref for manual testing purposes
|
||||
if (Preferences::GetBool(kForceEnableE10sPref, false)) {
|
||||
gBrowserTabsRemoteAutostart = true;
|
||||
}
|
||||
|
||||
mozilla::Telemetry::Accumulate(mozilla::Telemetry::E10S_AUTOSTART, gBrowserTabsRemoteAutostart);
|
||||
mozilla::Telemetry::Accumulate(mozilla::Telemetry::E10S_AUTOSTART_STATUS, status);
|
||||
if (Preferences::GetBool("browser.enabledE10SFromPrompt", false)) {
|
||||
|
|
|
@ -1768,16 +1768,6 @@ nsBaseWidget::GetTextEventDispatcher()
|
|||
|
||||
#ifdef ACCESSIBILITY
|
||||
|
||||
// defined in nsAppRunner.cpp
|
||||
extern const char* kAccessibilityLastRunDatePref;
|
||||
|
||||
static inline uint32_t
|
||||
PRTimeToSeconds(PRTime t_usec)
|
||||
{
|
||||
PRTime usec_per_sec = PR_USEC_PER_SEC;
|
||||
return uint32_t(t_usec /= usec_per_sec);
|
||||
}
|
||||
|
||||
a11y::Accessible*
|
||||
nsBaseWidget::GetRootAccessible()
|
||||
{
|
||||
|
@ -1796,8 +1786,6 @@ nsBaseWidget::GetRootAccessible()
|
|||
nsCOMPtr<nsIAccessibilityService> accService =
|
||||
services::GetAccessibilityService();
|
||||
if (accService) {
|
||||
uint32_t now = PRTimeToSeconds(PR_Now());
|
||||
Preferences::SetInt(kAccessibilityLastRunDatePref, now);
|
||||
return accService->GetRootDocumentAccessible(presShell, nsContentUtils::IsSafeToRunScript());
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче