summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-01-11 15:34:17 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-08 00:55:37 +0200
commit56d9003017a94e7619f98e76b04929115514d08c (patch)
tree952bd79e8cb7cfa2d071b6dbf13d95caed9d24fa
parente49b80dba7393d5baff831251f7981bc21324d81 (diff)
downloaduxp-56d9003017a94e7619f98e76b04929115514d08c.tar.gz
Issue #953 - Neuter the user-facing controls for e10s
This should prevent people using a massive footgun that would blow off their entire legs. Requires appropriate FE changes.
-rw-r--r--accessible/windows/msaa/Platform.cpp13
-rw-r--r--dom/base/nsObjectLoadingContent.cpp13
-rw-r--r--dom/push/PushNotifier.cpp7
-rw-r--r--embedding/components/windowwatcher/nsWindowWatcher.cpp14
-rw-r--r--gfx/config/gfxVars.h1
-rw-r--r--gfx/layers/ipc/CompositorBridgeParent.cpp10
-rw-r--r--gfx/thebes/gfxPlatform.cpp41
-rw-r--r--js/xpconnect/src/XPCShellImpl.cpp2
-rw-r--r--js/xpconnect/src/XPCWrappedNativeScope.cpp3
-rw-r--r--layout/forms/nsListControlFrame.cpp22
-rw-r--r--netwerk/protocol/http/HttpBaseChannel.cpp6
-rw-r--r--toolkit/components/thumbnails/BackgroundPageThumbs.jsm5
-rw-r--r--toolkit/xre/nsAppRunner.cpp84
-rw-r--r--widget/PuppetWidget.cpp8
-rw-r--r--xpcom/system/nsIXULRuntime.idl13
-rw-r--r--xpfe/appshell/nsAppShellService.cpp9
16 files changed, 10 insertions, 241 deletions
diff --git a/accessible/windows/msaa/Platform.cpp b/accessible/windows/msaa/Platform.cpp
index 56422f4a42..2bb6629fd1 100644
--- a/accessible/windows/msaa/Platform.cpp
+++ b/accessible/windows/msaa/Platform.cpp
@@ -35,19 +35,6 @@ a11y::PlatformInit()
nsWinUtils::MaybeStartWindowEmulation();
ia2AccessibleText::InitTextChangeData();
- if (BrowserTabsRemoteAutostart()) {
- mscom::InterceptorLog::Init();
- UniquePtr<RegisteredProxy> regProxy(
- mscom::RegisterProxy(L"ia2marshal.dll"));
- gRegProxy = regProxy.release();
- UniquePtr<RegisteredProxy> regAccTlb(
- mscom::RegisterTypelib(L"oleacc.dll",
- RegistrationFlags::eUseSystemDirectory));
- gRegAccTlb = regAccTlb.release();
- UniquePtr<RegisteredProxy> regMiscTlb(
- mscom::RegisterTypelib(L"Accessible.tlb"));
- gRegMiscTlb = regMiscTlb.release();
- }
}
void
diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp
index 128ec2a95d..f8541c61ba 100644
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -3363,19 +3363,6 @@ nsObjectLoadingContent::ShouldPlay(FallbackType &aReason, bool aIgnoreCurrentTyp
initializeObjectLoadingContentPrefs();
}
- if (BrowserTabsRemoteAutostart()) {
- bool shouldLoadInParent = nsPluginHost::ShouldLoadTypeInParent(mContentType);
- bool inParent = XRE_IsParentProcess();
-
- if (shouldLoadInParent != inParent) {
- // Plugins need to be locked to either the parent process or the content
- // process. If a plugin is locked to one process type, it can't be used in
- // the other. Otherwise we'll get hangs.
- aReason = eFallbackDisabled;
- return false;
- }
- }
-
RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
// at this point if it's not a plugin, we let it play/fallback
diff --git a/dom/push/PushNotifier.cpp b/dom/push/PushNotifier.cpp
index e60db2d975..5e2a637500 100644
--- a/dom/push/PushNotifier.cpp
+++ b/dom/push/PushNotifier.cpp
@@ -113,12 +113,7 @@ PushNotifier::Dispatch(PushDispatcher& aDispatcher)
return NS_OK;
}
- if (BrowserTabsRemoteAutostart()) {
- // e10s is enabled, but no content processes are active.
- return aDispatcher.HandleNoChildProcesses();
- }
-
- // e10s is disabled; notify workers in the parent.
+ // Notify workers in the parent.
return aDispatcher.NotifyWorkers();
}
diff --git a/embedding/components/windowwatcher/nsWindowWatcher.cpp b/embedding/components/windowwatcher/nsWindowWatcher.cpp
index 7839228cfc..bd931233bc 100644
--- a/embedding/components/windowwatcher/nsWindowWatcher.cpp
+++ b/embedding/components/windowwatcher/nsWindowWatcher.cpp
@@ -1883,19 +1883,7 @@ nsWindowWatcher::CalculateChromeFlagsForParent(mozIDOMWindowProxy* aParent,
chromeFlags |= WinHasOption(aFeatures, "non-private", 0, &presenceFlag) ?
nsIWebBrowserChrome::CHROME_NON_PRIVATE_WINDOW : 0;
- // Determine whether the window should have remote tabs.
- bool remote = BrowserTabsRemoteAutostart();
-
- if (remote) {
- remote = !WinHasOption(aFeatures, "non-remote", 0, &presenceFlag);
- } else {
- remote = WinHasOption(aFeatures, "remote", 0, &presenceFlag);
- }
-
- if (remote) {
- chromeFlags |= nsIWebBrowserChrome::CHROME_REMOTE_WINDOW;
- }
-
+ // Check if it's a popup window
chromeFlags |= WinHasOption(aFeatures, "popup", 0, &presenceFlag) ?
nsIWebBrowserChrome::CHROME_WINDOW_POPUP : 0;
diff --git a/gfx/config/gfxVars.h b/gfx/config/gfxVars.h
index fd4864dd56..6ac8c21326 100644
--- a/gfx/config/gfxVars.h
+++ b/gfx/config/gfxVars.h
@@ -22,7 +22,6 @@ class gfxVarReceiver;
// Generator for graphics vars.
#define GFX_VARS_LIST(_) \
/* C++ Name, Data Type, Default Value */ \
- _(BrowserTabsRemoteAutostart, bool, false) \
_(ContentBackend, BackendType, BackendType::NONE) \
_(TileSize, IntSize, IntSize(-1, -1)) \
_(UseXRender, bool, false) \
diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp
index e650b2dcf1..d08176b6a5 100644
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -1183,16 +1183,6 @@ CompositorBridgeParent::CompositeToTarget(DrawTarget* aTarget, const gfx::IntRec
&hasRemoteContent,
&updatePluginsFlag);
-#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
- // We do not support plugins in local content. When switching tabs
- // to local pages, hide every plugin associated with the window.
- if (!hasRemoteContent && gfxVars::BrowserTabsRemoteAutostart() &&
- mCachedPluginData.Length()) {
- Unused << SendHideAllPlugins(GetWidget()->GetWidgetKey());
- mCachedPluginData.Clear();
- }
-#endif
-
if (aTarget) {
mLayerManager->BeginTransactionWithDrawTarget(aTarget, *aRect);
} else {
diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
index 28282a90d2..21e15bf06f 100644
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -519,12 +519,7 @@ static uint32_t GetSkiaGlyphCacheSize()
// Chromium uses 20mb and skia default uses 2mb.
// We don't need to change the font cache count since we usually
// cache thrash due to asian character sets in talos.
- // Only increase memory on the content proces
uint32_t cacheSize = 10 * 1024 * 1024;
- if (mozilla::BrowserTabsRemoteAutostart()) {
- return XRE_IsContentProcess() ? cacheSize : kDefaultGlyphCacheSize;
- }
-
return cacheSize;
}
#endif
@@ -2023,7 +2018,6 @@ gfxPlatform::InitAcceleration()
gfxPrefs::GetSingleton();
if (XRE_IsParentProcess()) {
- gfxVars::SetBrowserTabsRemoteAutostart(BrowserTabsRemoteAutostart());
gfxVars::SetOffscreenFormat(GetOffscreenFormat());
gfxVars::SetRequiresAcceleratedGLContextForCompositorOGL(
RequiresAcceleratedGLContextForCompositorOGL());
@@ -2075,30 +2069,11 @@ gfxPlatform::InitGPUProcessPrefs()
gpuProc.UserForceEnable("User force-enabled via pref");
}
- // We require E10S - otherwise, there is very little benefit to the GPU
- // process, since the UI process must still use acceleration for
- // performance.
- if (!BrowserTabsRemoteAutostart()) {
- gpuProc.ForceDisable(
- FeatureStatus::Unavailable,
- "Multi-process mode is not enabled",
- NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_E10S"));
- return;
- }
- if (InSafeMode()) {
- gpuProc.ForceDisable(
- FeatureStatus::Blocked,
- "Safe-mode is enabled",
- NS_LITERAL_CSTRING("FEATURE_FAILURE_SAFE_MODE"));
- return;
- }
- if (gfxPrefs::LayerScopeEnabled()) {
- gpuProc.ForceDisable(
- FeatureStatus::Blocked,
- "LayerScope does not work in the GPU process",
- NS_LITERAL_CSTRING("FEATURE_FAILURE_LAYERSCOPE"));
- return;
- }
+ gpuProc.ForceDisable(
+ FeatureStatus::Unavailable,
+ "GPU processes are not supported",
+ NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_E10S"));
+ return;
}
void
@@ -2203,9 +2178,7 @@ gfxPlatform::UsesOffMainThreadCompositing()
if (firstTime) {
MOZ_ASSERT(sLayersAccelerationPrefsInitialized);
- result =
- gfxVars::BrowserTabsRemoteAutostart() ||
- !gfxPrefs::LayersOffMainThreadCompositionForceDisabled();
+ result = !gfxPrefs::LayersOffMainThreadCompositionForceDisabled();
#if defined(MOZ_WIDGET_GTK)
// Linux users who chose OpenGL are being grandfathered in to OMTC
result |= gfxPrefs::LayersAccelerationForceEnabledDoNotUseDirectly();
@@ -2302,7 +2275,7 @@ gfxPlatform::AsyncPanZoomEnabled()
#if !defined(MOZ_WIDGET_UIKIT)
// For XUL applications (everything but Firefox on Android) we only want
// to use APZ when E10S is enabled or when the user explicitly enable it.
- if (BrowserTabsRemoteAutostart() || gfxPrefs::APZDesktopEnabled()) {
+ if (gfxPrefs::APZDesktopEnabled()) {
return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly();
} else {
return false;
diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp
index 6c5fa30877..72ab89c402 100644
--- a/js/xpconnect/src/XPCShellImpl.cpp
+++ b/js/xpconnect/src/XPCShellImpl.cpp
@@ -1433,8 +1433,6 @@ XRE_XPCShellMain(int argc, char** argv, char** envp)
// Initialize graphics prefs on the main thread, if not already done
gfxPrefs::GetSingleton();
- // Initialize e10s check on the main thread, if not already done
- BrowserTabsRemoteAutostart();
#ifdef XP_WIN
// Plugin may require audio session if installed plugin can initialize
// asynchronized.
diff --git a/js/xpconnect/src/XPCWrappedNativeScope.cpp b/js/xpconnect/src/XPCWrappedNativeScope.cpp
index fdf27a5d62..4f4e9e7404 100644
--- a/js/xpconnect/src/XPCWrappedNativeScope.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp
@@ -247,8 +247,7 @@ CompartmentPerAddon()
static bool pref = false;
if (!initialized) {
- pref = Preferences::GetBool("dom.compartment_per_addon", false) ||
- BrowserTabsRemoteAutostart();
+ pref = Preferences::GetBool("dom.compartment_per_addon", false);
initialized = true;
}
diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp
index 12fc4a2dde..50e05776ef 100644
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -141,14 +141,6 @@ nsListControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
mContent->RemoveSystemEventListener(NS_LITERAL_STRING("mousemove"),
mEventListener, false);
- if (XRE_IsContentProcess() &&
- Preferences::GetBool("browser.tabs.remote.desktopbehavior", false)) {
- nsContentUtils::AddScriptRunner(
- new AsyncEventDispatcher(mContent,
- NS_LITERAL_STRING("mozhidedropdown"), true,
- true));
- }
-
nsFormControlFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), false);
nsHTMLScrollFrame::DestroyFrom(aDestructRoot);
}
@@ -1775,20 +1767,6 @@ nsListControlFrame::GetIndexFromDOMEvent(nsIDOMEvent* aMouseEvent,
static bool
FireShowDropDownEvent(nsIContent* aContent, bool aShow, bool aIsSourceTouchEvent)
{
- if (XRE_IsContentProcess() &&
- Preferences::GetBool("browser.tabs.remote.desktopbehavior", false)) {
- nsString eventName;
- if (aShow) {
- eventName = aIsSourceTouchEvent ? NS_LITERAL_STRING("mozshowdropdown-sourcetouch") :
- NS_LITERAL_STRING("mozshowdropdown");
- } else {
- eventName = NS_LITERAL_STRING("mozhidedropdown");
- }
- nsContentUtils::DispatchChromeEvent(aContent->OwnerDoc(), aContent,
- eventName, true, false);
- return true;
- }
-
return false;
}
diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp
index 877915acb5..e62ec3a2e7 100644
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -3642,12 +3642,6 @@ HttpBaseChannel::GetPerformance()
return nullptr;
}
- // There is no point in continuing, since the performance object in the parent
- // isn't the same as the one in the child which will be reporting resource performance.
- if (XRE_IsParentProcess() && BrowserTabsRemoteAutostart()) {
- return nullptr;
- }
-
if (!mLoadInfo) {
return nullptr;
}
diff --git a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
index 77b7c8e2ca..4c7ca90e1d 100644
--- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
+++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
@@ -179,11 +179,6 @@ const BackgroundPageThumbs = {
browser.setAttribute("type", "content");
browser.setAttribute("disableglobalhistory", "true");
- if (Services.prefs.getPrefType("browser.tabs.remote") == Services.prefs.PREF_BOOL &&
- Services.prefs.getBoolPref("browser.tabs.remote")) {
- browser.setAttribute("remote", "true");
- }
-
// Size the browser. Make its aspect ratio the same as the canvases' that
// the thumbnails are drawn into; the canvases' aspect ratio is the same as
// the screen's, so use that. Aim for a size in the ballpark of 1024x768.
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
index 90e29f5517..932325458e 100644
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -825,42 +825,15 @@ nsXULAppInfo::GetUniqueProcessID(uint64_t* aResult)
return NS_OK;
}
-static bool gBrowserTabsRemoteAutostart = false;
-static uint64_t gBrowserTabsRemoteStatus = 0;
-static bool gBrowserTabsRemoteAutostartInitialized = false;
-
-static bool gMultiprocessBlockPolicyInitialized = false;
-static uint32_t gMultiprocessBlockPolicy = 0;
-
NS_IMETHODIMP
nsXULAppInfo::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData) {
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
-nsXULAppInfo::GetBrowserTabsRemoteAutostart(bool* aResult)
-{
- *aResult = BrowserTabsRemoteAutostart();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::GetMultiprocessBlockPolicy(uint32_t* aResult)
-{
- *aResult = MultiprocessBlockPolicy();
- return NS_OK;
-}
-
-NS_IMETHODIMP
nsXULAppInfo::GetAccessibilityEnabled(bool* aResult)
{
#ifdef ACCESSIBILITY
@@ -4053,21 +4026,6 @@ XRE_IsContentProcess()
return XRE_GetProcessType() == GeckoProcessType_Content;
}
-// If you add anything to this enum, please update about:support to reflect it
-enum {
- kE10sEnabledByUser = 0,
- 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,
- kE10sForceDisabled = 8,
- // kE10sDisabledForXPAcceleration = 9, removed in bug 1296353
- // kE10sDisabledForOperatingSystem = 10, removed due to xp-eol
-};
-
const char* kAccessibilityLastRunDatePref = "accessibility.lastLoadDate";
const char* kAccessibilityLoadedLastSessionPref = "accessibility.loadedInLastSession";
@@ -4080,48 +4038,6 @@ PRTimeToSeconds(PRTime t_usec)
}
#endif
-uint32_t
-MultiprocessBlockPolicy() {
- if (gMultiprocessBlockPolicyInitialized) {
- return gMultiprocessBlockPolicy;
- }
- gMultiprocessBlockPolicyInitialized = true;
-
- // We do not support E10S, block by policy.
- gMultiprocessBlockPolicy = kE10sForceDisabled;
-
- return gMultiprocessBlockPolicy;
-}
-
-bool
-mozilla::BrowserTabsRemoteAutostart()
-{
- if (gBrowserTabsRemoteAutostartInitialized) {
- return gBrowserTabsRemoteAutostart;
- }
- gBrowserTabsRemoteAutostartInitialized = true;
-
- bool optInPref = Preferences::GetBool("browser.tabs.remote.autostart", false);
- bool trialPref = Preferences::GetBool("browser.tabs.remote.autostart.2", false);
- bool prefEnabled = optInPref || trialPref;
- int status;
-
- if (prefEnabled) {
- uint32_t blockPolicy = MultiprocessBlockPolicy();
- if (blockPolicy != 0) {
- status = blockPolicy;
- } else {
- MOZ_CRASH("e10s force enabled bypassing policy -- unsupported configuration");
- }
- } else {
- status = kE10sDisabledByUser;
- }
-
- gBrowserTabsRemoteStatus = status;
-
- return gBrowserTabsRemoteAutostart;
-}
-
void
SetupErrorHandling(const char* progname)
{
diff --git a/widget/PuppetWidget.cpp b/widget/PuppetWidget.cpp
index 657f70551d..35496d4971 100644
--- a/widget/PuppetWidget.cpp
+++ b/widget/PuppetWidget.cpp
@@ -1172,14 +1172,6 @@ PuppetWidget::MemoryPressureObserver::Remove()
bool
PuppetWidget::NeedsPaint()
{
- // e10s popups are handled by the parent process, so never should be painted here
- if (XRE_IsContentProcess() &&
- Preferences::GetBool("browser.tabs.remote.desktopbehavior", false) &&
- mWindowType == eWindowType_popup) {
- NS_WARNING("Trying to paint an e10s popup in the child process!");
- return false;
- }
-
return mVisible;
}
diff --git a/xpcom/system/nsIXULRuntime.idl b/xpcom/system/nsIXULRuntime.idl
index 994084c0a4..d3f3535472 100644
--- a/xpcom/system/nsIXULRuntime.idl
+++ b/xpcom/system/nsIXULRuntime.idl
@@ -92,19 +92,6 @@ interface nsIXULRuntime : nsISupports
readonly attribute uint64_t uniqueProcessID;
/**
- * If true, browser tabs may be opened by default in a different process
- * from the main browser UI.
- */
- readonly attribute boolean browserTabsRemoteAutostart;
-
- /**
- * A numeric value indicating whether multiprocess might be blocked.
- * Possible values can be found at nsAppRunner.cpp. A value of 0
- * represents not blocking.
- */
- readonly attribute unsigned long multiprocessBlockPolicy;
-
- /**
* If true, the accessibility service is running.
*/
readonly attribute boolean accessibilityEnabled;
diff --git a/xpfe/appshell/nsAppShellService.cpp b/xpfe/appshell/nsAppShellService.cpp
index 868bd78123..427428fdf9 100644
--- a/xpfe/appshell/nsAppShellService.cpp
+++ b/xpfe/appshell/nsAppShellService.cpp
@@ -699,15 +699,11 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent,
// Enforce the Private Browsing autoStart pref first.
bool isPrivateBrowsingWindow =
Preferences::GetBool("browser.privatebrowsing.autostart");
- bool isUsingRemoteTabs = mozilla::BrowserTabsRemoteAutostart();
if (aChromeMask & nsIWebBrowserChrome::CHROME_PRIVATE_WINDOW) {
// Caller requested a private window
isPrivateBrowsingWindow = true;
}
- if (aChromeMask & nsIWebBrowserChrome::CHROME_REMOTE_WINDOW) {
- isUsingRemoteTabs = true;
- }
nsCOMPtr<mozIDOMWindowProxy> domWin = do_GetInterface(aParent);
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(domWin);
@@ -720,17 +716,12 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent,
isPrivateBrowsingWindow = parentContext->UsePrivateBrowsing();
}
- if (parentContext) {
- isUsingRemoteTabs = parentContext->UseRemoteTabs();
- }
-
nsCOMPtr<mozIDOMWindowProxy> newDomWin =
do_GetInterface(NS_ISUPPORTS_CAST(nsIBaseWindow*, window));
nsCOMPtr<nsIWebNavigation> newWebNav = do_GetInterface(newDomWin);
nsCOMPtr<nsILoadContext> thisContext = do_GetInterface(newWebNav);
if (thisContext) {
thisContext->SetPrivateBrowsing(isPrivateBrowsingWindow);
- thisContext->SetRemoteTabs(isUsingRemoteTabs);
}
window.forget(aResult);