From 809cd2a13ee9772e0f68d53fdd08873ca1e17f36 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Wed, 9 Mar 2022 03:18:04 +0000 Subject: [PATCH] Bug 1598759 - Remove support for Large-Allocation HTTP header. r=nika,fluent-reviewers Differential Revision: https://phabricator.services.mozilla.com/D140459 --- .../client/netmonitor/src/utils/doc-utils.js | 1 - docshell/base/CanonicalBrowsingContext.cpp | 11 +- dom/base/ChromeUtils.cpp | 5 +- dom/chrome-webidl/ChromeUtils.webidl | 1 - dom/docs/ipc/process_model.rst | 15 +- dom/docs/navigation/nav_replace.rst | 2 - dom/ipc/ContentChild.cpp | 2 - dom/ipc/ContentParent.cpp | 12 +- dom/ipc/ProcessIsolation.cpp | 56 -- dom/ipc/RemoteType.h | 1 - .../test/csp/file_reloadInFreshProcess.sjs | 86 --- dom/security/test/csp/mochitest.ini | 6 - .../test/csp/test_reloadInFreshProcess.html | 83 --- dom/tests/browser/browser.ini | 20 - dom/tests/browser/browser_allocateGigabyte.js | 45 -- .../browser_largeAllocation_non_win32.js | 43 -- .../browser/browser_largeAllocation_win32.js | 20 - dom/tests/browser/helper_largeAllocation.js | 600 ------------------ dom/tests/browser/test_largeAllocation.html | 10 - .../test_largeAllocation.html^headers^ | 1 - dom/tests/browser/test_largeAllocation2.html | 4 - .../test_largeAllocation2.html^headers^ | 1 - .../test_largeAllocationFormSubmit.sjs | 27 - .../remoteworkers/RemoteWorkerManager.cpp | 4 - modules/libpref/init/StaticPrefList.yaml | 11 - modules/libpref/init/all.js | 3 - .../aboutprocesses/content/aboutProcesses.js | 5 - toolkit/components/processtools/ProcInfo.h | 1 - .../en-US/toolkit/about/aboutProcesses.ftl | 2 - .../en-US/toolkit/global/processTypes.ftl | 4 - toolkit/modules/E10SUtils.jsm | 17 +- toolkit/modules/ProcessType.jsm | 1 - .../test_E10SUtils_workers_remote_types.js | 14 +- 33 files changed, 16 insertions(+), 1098 deletions(-) delete mode 100644 dom/security/test/csp/file_reloadInFreshProcess.sjs delete mode 100644 dom/security/test/csp/test_reloadInFreshProcess.html delete mode 100644 dom/tests/browser/browser_allocateGigabyte.js delete mode 100644 dom/tests/browser/browser_largeAllocation_non_win32.js delete mode 100644 dom/tests/browser/browser_largeAllocation_win32.js delete mode 100644 dom/tests/browser/helper_largeAllocation.js delete mode 100644 dom/tests/browser/test_largeAllocation.html delete mode 100644 dom/tests/browser/test_largeAllocation.html^headers^ delete mode 100644 dom/tests/browser/test_largeAllocation2.html delete mode 100644 dom/tests/browser/test_largeAllocation2.html^headers^ delete mode 100644 dom/tests/browser/test_largeAllocationFormSubmit.sjs diff --git a/devtools/client/netmonitor/src/utils/doc-utils.js b/devtools/client/netmonitor/src/utils/doc-utils.js index 54774a6428b9..e42252fc0652 100644 --- a/devtools/client/netmonitor/src/utils/doc-utils.js +++ b/devtools/client/netmonitor/src/utils/doc-utils.js @@ -60,7 +60,6 @@ const SUPPORTED_HEADERS = [ "If-Range", "If-Unmodified-Since", "Keep-Alive", - "Large-Allocation", "Last-Modified", "Location", "Origin", diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp index cac44a7b9a60..bbe551cc675e 100644 --- a/docshell/base/CanonicalBrowsingContext.cpp +++ b/docshell/base/CanonicalBrowsingContext.cpp @@ -1928,12 +1928,11 @@ CanonicalBrowsingContext::ChangeRemoteness( // If we're aiming to end up in a new process of the same type as our old // process, and then putting our previous document in the BFCache, try to stay - // in the same process to avoid creating new processes unnecessarially. + // in the same process to avoid creating new processes unnecessarily. RefPtr existingProcess = GetContentParent(); if (existingProcess && existingProcess->IsAlive() && aOptions.mReplaceBrowsingContext && - aOptions.mRemoteType == existingProcess->GetRemoteType() && - aOptions.mRemoteType != LARGE_ALLOCATION_REMOTE_TYPE) { + aOptions.mRemoteType == existingProcess->GetRemoteType()) { change->mContentParent = existingProcess; change->mContentParent->AddKeepAlive(); change->ProcessLaunched(); @@ -2591,12 +2590,6 @@ bool CanonicalBrowsingContext::AllowedInBFCache( return false; } - nsAutoCString remoteType; - GetCurrentRemoteType(remoteType, IgnoredErrorResult()); - if (remoteType == LARGE_ALLOCATION_REMOTE_TYPE) { - return false; - } - uint32_t bfcacheCombo = 0; if (mRestoreState) { bfcacheCombo |= BFCacheStatus::RESTORING; diff --git a/dom/base/ChromeUtils.cpp b/dom/base/ChromeUtils.cpp index e65a0dc8e249..e984581c4aaa 100644 --- a/dom/base/ChromeUtils.cpp +++ b/dom/base/ChromeUtils.cpp @@ -870,7 +870,7 @@ static WebIDLProcType ProcTypeToWebIDL(mozilla::ProcType aType) { PROCTYPE_TO_WEBIDL_CASE(PrivilegedMozilla, Privilegedmozilla); PROCTYPE_TO_WEBIDL_CASE(WebCOOPCOEP, WithCoopCoep); PROCTYPE_TO_WEBIDL_CASE(WebServiceWorker, WebServiceWorker); - PROCTYPE_TO_WEBIDL_CASE(WebLargeAllocation, WebLargeAllocation); + #define GECKO_PROCESS_TYPE(enum_value, enum_name, string_name, proc_typename, \ process_bin_type, procinfo_typename, \ webidl_typename, allcaps_name) \ @@ -885,6 +885,7 @@ static WebIDLProcType ProcTypeToWebIDL(mozilla::ProcType aType) { # undef SKIP_PROCESS_TYPE_FORKSERVER #endif // MOZ_ENABLE_FORKSERVER #undef GECKO_PROCESS_TYPE + PROCTYPE_TO_WEBIDL_CASE(Preallocated, Preallocated); PROCTYPE_TO_WEBIDL_CASE(Unknown, Unknown); } @@ -1036,8 +1037,6 @@ already_AddRefed ChromeUtils::RequestProcInfo(GlobalObject& aGlobal, type = mozilla::ProcType::PrivilegedAbout; } else if (remoteType == PRIVILEGEDMOZILLA_REMOTE_TYPE) { type = mozilla::ProcType::PrivilegedMozilla; - } else if (remoteType == LARGE_ALLOCATION_REMOTE_TYPE) { - type = mozilla::ProcType::WebLargeAllocation; } else if (remoteType == PREALLOC_REMOTE_TYPE) { type = mozilla::ProcType::Preallocated; } else if (StringBeginsWith(remoteType, DEFAULT_REMOTE_TYPE)) { diff --git a/dom/chrome-webidl/ChromeUtils.webidl b/dom/chrome-webidl/ChromeUtils.webidl index 9b7f0b7409ad..46703e4c3f95 100644 --- a/dom/chrome-webidl/ChromeUtils.webidl +++ b/dom/chrome-webidl/ChromeUtils.webidl @@ -618,7 +618,6 @@ enum WebIDLProcType { "extension", "privilegedabout", "privilegedmozilla", - "webLargeAllocation", "withCoopCoep", "webServiceWorker", "browser", diff --git a/dom/docs/ipc/process_model.rst b/dom/docs/ipc/process_model.rst index 422e78714dc5..d07595a730db 100644 --- a/dom/docs/ipc/process_model.rst +++ b/dom/docs/ipc/process_model.rst @@ -33,7 +33,6 @@ Diagram Shared Web Content
(web) Isolated Web Content
(webIsolated=$SITE) COOP+COEP Web Content
(webCOOP+COEP=$SITE) - Large Allocation Web Content
(webLargeAlloc) ServiceWorker Web Content
(webServiceWorker) > @@ -206,25 +205,13 @@ Like Isolated Web Content, these processes are keyed by the site loaded within t In ``about:processes``, COOP+COEP Web Content processes will be listed with a "cross-origin isolated" note after the PID, like ``https://example.com (12345, cross-origin isolated)``. -Large Allocation Web Content -"""""""""""""""""""""""""""" - -:remoteType: ``webLargeAlloc`` -:default count: 10 (``dom.ipc.processCount.webLargeAlloc``) -:platform: 32-bit Windows only (``dom.largeAllocation.forceEnable``) - -Document loads with the non-standard ``Large-Allocation`` header are requesting to be placed into a separate content process such that they can have access to a less-fragmented address space. This was originally designed to enable 32-bit Windows platforms to load and run asm.js and wasm code more easily. - -This header is only supported on 32-bit Windows, and will likely be removed in the near future. - ServiceWorker Web Content """""""""""""""""""" :remoteType: ``webServiceWorker=$SITE`` :default count: 1 per-site using ServiceWorkers -ServiceWorker web content processes are used to host ServiceWorkers on a per-site basis, so that ServiceWorker operations aren't impacted by MainThread event latency when running in the same process as the content for the page. ServiceWorkers are usually transitory, and will disappear if unused for a short period of time. - +ServiceWorker web content processes are used to host ServiceWorkers on a per-site basis, so that ServiceWorker operations aren't impacted by MainThread event latency whenrunning in the same process as the content for the page. ServiceWorkers are usually transitory, and will disappear if unused for a short period of time. Gecko Media Plugins (GMP) Process --------------------------------- diff --git a/dom/docs/navigation/nav_replace.rst b/dom/docs/navigation/nav_replace.rst index 6c92e5eefbd0..6e2c710e285c 100644 --- a/dom/docs/navigation/nav_replace.rst +++ b/dom/docs/navigation/nav_replace.rst @@ -99,8 +99,6 @@ in the following circumstances, though this may change in the future: - When switching processes between the parent process, and a content process. - When loading an extension document in a toplevel browsing context. - When navigating away from a preloaded ``about:newtab`` document. -- Sometimes, when loading a document with the ``Large-Allocation`` header on - 32-bit windows. - When putting a ``BrowsingContext`` into BFCache for the session history in-parent BFCache implementation. This will happen on most toplevel navigations without opener relationships when the ``fission.bfcacheInParent`` diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 46b4550b035f..ff8144a8ae74 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -2737,8 +2737,6 @@ mozilla::ipc::IPCResult ContentChild::RecvRemoteType( SetProcessName("WebExtensions"_ns); } else if (aRemoteType == PRIVILEGEDABOUT_REMOTE_TYPE) { SetProcessName("Privileged Content"_ns); - } else if (aRemoteType == LARGE_ALLOCATION_REMOTE_TYPE) { - SetProcessName("Large Allocation Web Content"_ns); } else if (remoteTypePrefix == WITH_COOP_COEP_REMOTE_TYPE) { #ifdef NIGHTLY_BUILD SetProcessName("WebCOOP+COEP Content"_ns); diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 424f7e830019..b85fab3d4492 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -740,8 +740,7 @@ const nsDependentCSubstring RemoteTypePrefix( } bool IsWebRemoteType(const nsACString& aContentProcessType) { - // Note: matches webIsolated as well as web (and webLargeAllocation, and - // webCOOP+COEP) + // Note: matches webIsolated, web, and webCOOP+COEP types. return StringBeginsWith(aContentProcessType, DEFAULT_REMOTE_TYPE); } @@ -1052,15 +1051,6 @@ ContentParent::GetNewOrUsedLaunchingBrowserProcess( nsTArray& contentParents = GetOrCreatePool(aRemoteType); uint32_t maxContentParents = GetMaxProcessCount(aRemoteType); - // We never want to re-use Large-Allocation processes. - if (aRemoteType == LARGE_ALLOCATION_REMOTE_TYPE && - contentParents.Length() >= maxContentParents) { - MOZ_LOG(ContentParent::GetLog(), LogLevel::Debug, - ("GetNewOrUsedProcess: returning Large Used process")); - return GetNewOrUsedLaunchingBrowserProcess(DEFAULT_REMOTE_TYPE, aGroup, - aPriority, - /*aPreferUsed =*/false); - } // Let's try and reuse an existing process. contentParent = GetUsedBrowserProcess( diff --git a/dom/ipc/ProcessIsolation.cpp b/dom/ipc/ProcessIsolation.cpp index f410bc70e90e..48f12fdc24f0 100644 --- a/dom/ipc/ProcessIsolation.cpp +++ b/dom/ipc/ProcessIsolation.cpp @@ -382,38 +382,6 @@ static already_AddRefed GetAboutReaderURLPrincipal( return nullptr; } -/** - * Check if the given load has the `Large-Allocation` header set, and the header - * is enabled. - */ -static bool IsLargeAllocationLoad(CanonicalBrowsingContext* aBrowsingContext, - nsIChannel* aChannel) { - if (!StaticPrefs::dom_largeAllocationHeader_enabled() || - aBrowsingContext->UseRemoteSubframes()) { - return false; - } - - nsCOMPtr httpChannel = do_QueryInterface(aChannel); - if (!httpChannel) { - return false; - } - - nsAutoCString ignoredHeaderValue; - nsresult rv = - httpChannel->GetResponseHeader("Large-Allocation"_ns, ignoredHeaderValue); - if (NS_FAILED(rv)) { - return false; - } - - // On all platforms other than win32, LargeAllocation is disabled by default, - // and has to be force-enabled using `dom.largeAllocation.forceEnable`. -#if defined(XP_WIN) && defined(_X86_) - return true; -#else - return StaticPrefs::dom_largeAllocation_forceEnable(); -#endif -} - /** * Returns `true` if loads for this site should be isolated on a per-site basis. * If `aTopBC` is nullptr, this is being called to check if a shared or service @@ -776,30 +744,6 @@ Result IsolationOptionsForNavigation( options.mReplaceBrowsingContext = true; } - // Handle the deprecated Large-Allocation header. - if (!aTopBC->UseRemoteSubframes()) { - MOZ_ASSERT(!aParentWindow, - "subframe switch when `UseRemoteSubframes()` is false?"); - bool singleToplevel = aTopBC->Group()->Toplevels().Length() == 1; - bool isLargeAllocLoad = IsLargeAllocationLoad(aTopBC, aChannel); - // If we're starting a large-alloc load and have no opener relationships, - // force the load to finish in the large-allocation remote type. - if (isLargeAllocLoad && singleToplevel) { - options.mRemoteType = LARGE_ALLOCATION_REMOTE_TYPE; - options.mReplaceBrowsingContext = true; - return options; - } - if (aCurrentRemoteType == LARGE_ALLOCATION_REMOTE_TYPE) { - // If we're doing a non-large-alloc load, we may still need to finish in - // the large-allocation remote type if we have opener relationships. - if (!singleToplevel) { - options.mRemoteType = LARGE_ALLOCATION_REMOTE_TYPE; - return options; - } - options.mReplaceBrowsingContext = true; - } - } - nsAutoCString siteOriginNoSuffix; MOZ_TRY(resultOrPrecursor->GetSiteOriginNoSuffix(siteOriginNoSuffix)); diff --git a/dom/ipc/RemoteType.h b/dom/ipc/RemoteType.h index 525edc469676..0067f19baade 100644 --- a/dom/ipc/RemoteType.h +++ b/dom/ipc/RemoteType.h @@ -27,7 +27,6 @@ #define FISSION_WEB_REMOTE_TYPE "webIsolated"_ns #define WITH_COOP_COEP_REMOTE_TYPE "webCOOP+COEP"_ns #define WITH_COOP_COEP_REMOTE_TYPE_PREFIX "webCOOP+COEP="_ns -#define LARGE_ALLOCATION_REMOTE_TYPE "webLargeAllocation"_ns #define SERVICEWORKER_REMOTE_TYPE "webServiceWorker"_ns // Remote type value used to represent being non-remote. diff --git a/dom/security/test/csp/file_reloadInFreshProcess.sjs b/dom/security/test/csp/file_reloadInFreshProcess.sjs deleted file mode 100644 index cd65266b6373..000000000000 --- a/dom/security/test/csp/file_reloadInFreshProcess.sjs +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; - -const TESTFRAME_QUERY_LARGE_ALLOCATION_WITH_NO_CSP = ` - - - Bug 1555050 - Test CSP Navigation using ReloadInFreshProcess - - - testframe
- - - `; - -const TESTFRAME_QUERY_LARGE_ALLOCATION_WITH_CSP = ` - - - Bug 1555050 - Test CSP Navigation using ReloadInFreshProcess - - - testframe
- - - `; - -const LARGE_ALLOCATION = ` - - - Bug 1555050 - Test CSP Navigation using ReloadInFreshProcess - - - largeAllocation
- - - `; - -function handleRequest(request, response) { - // avoid confusing cache behaviors - response.setHeader("Cache-Control", "no-cache", false); - - var queryString = request.queryString; - - if (queryString == "testframe_with_csp") { - response.setHeader( - "Content-Security-Policy", - "upgrade-insecure-requests", - false - ); - response.write(TESTFRAME_QUERY_LARGE_ALLOCATION_WITH_NO_CSP); - return; - } - - if (queryString == "testframe_with_no_csp") { - response.write(TESTFRAME_QUERY_LARGE_ALLOCATION_WITH_CSP); - return; - } - - if (queryString == "largeAllocation_with_csp") { - response.setHeader( - "Content-Security-Policy", - "upgrade-insecure-requests", - false - ); - response.setHeader("Large-Allocation", "0", false); - response.write(LARGE_ALLOCATION); - return; - } - - if (queryString == "largeAllocation_with_no_csp") { - response.setHeader("Large-Allocation", "0", false); - response.write(LARGE_ALLOCATION); - return; - } - - // we should never get here, but just in case return something unexpected - response.write("do'h"); -} diff --git a/dom/security/test/csp/mochitest.ini b/dom/security/test/csp/mochitest.ini index 00dcf82c9a2d..ecdc6333ce84 100644 --- a/dom/security/test/csp/mochitest.ini +++ b/dom/security/test/csp/mochitest.ini @@ -413,12 +413,6 @@ support-files = support-files = file_script_template.html file_script_template.js -[test_reloadInFreshProcess.html] -# no e10s-multi support on android and no large-allocation on win32 -skip-if = - (toolkit == 'android') || (os == 'win' && bits == 32) -support-files = - file_reloadInFreshProcess.sjs [test_parent_location_js.html] support-files = file_parent_location_js.html diff --git a/dom/security/test/csp/test_reloadInFreshProcess.html b/dom/security/test/csp/test_reloadInFreshProcess.html deleted file mode 100644 index 4423b6c92c31..000000000000 --- a/dom/security/test/csp/test_reloadInFreshProcess.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - Bug 1555050: Test CSP Navigation using ReloadInFreshProcess - - - - - - - - - - diff --git a/dom/tests/browser/browser.ini b/dom/tests/browser/browser.ini index 2ad95d6dfc63..bef041322e56 100644 --- a/dom/tests/browser/browser.ini +++ b/dom/tests/browser/browser.ini @@ -14,18 +14,9 @@ support-files = geo_leak_test.html dummy.html dummy.png - test_largeAllocation.html - test_largeAllocation.html^headers^ - test_largeAllocation2.html - test_largeAllocation2.html^headers^ - test_largeAllocationFormSubmit.sjs - helper_largeAllocation.js helper_localStorage.js !/dom/tests/mochitest/geolocation/network_geolocation.sjs -[browser_allocateGigabyte.js] -disabled = Does not reliably pass on 32-bit systems - bug 1314098 -skip-if = !e10s [browser_autofocus_background.js] [browser_autofocus_preference.js] [browser_beforeunload_between_chrome_content.js] @@ -72,17 +63,6 @@ support-files = skip-if = os == "linux" && bits == 64 # Bug 1742012 os == "win" && debug # Bug 1742012 -[browser_largeAllocation_win32.js] -https_first_disabled = true -skip-if = fission - !e10s - os != "win" - processor != "x86" # Large-Allocation requires non-fission e10s -[browser_largeAllocation_non_win32.js] -https_first_disabled = true -skip-if = fission - !e10s - (os == "win" && processor == "x86") # Large-Allocation requires non-fission e10s [browser_localStorage_e10s.js] https_first_disabled = true fail-if = fission diff --git a/dom/tests/browser/browser_allocateGigabyte.js b/dom/tests/browser/browser_allocateGigabyte.js deleted file mode 100644 index 602dbd791bc5..000000000000 --- a/dom/tests/browser/browser_allocateGigabyte.js +++ /dev/null @@ -1,45 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -const TEST_URI = - "http://example.com/browser/dom/tests/browser/test_largeAllocation.html"; - -function expectProcessCreated() { - let os = Services.obs; - return new Promise(resolve => { - let topic = "ipc:content-created"; - function observer() { - os.removeObserver(observer, topic); - ok(true, "Expect process created"); - resolve(); - } - os.addObserver(observer, topic); - }); -} - -add_task(async function() { - await SpecialPowers.pushPrefEnv({ - set: [["dom.largeAllocationHeader.enabled", true]], - }); - - // A toplevel tab should be able to navigate cross process! - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - let epc = expectProcessCreated(); - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - // Wait for the new process to be created by the Large-Allocation header - await epc; - - // Allocate a gigabyte of memory in the content process - await SpecialPowers.spawn(aBrowser, [], () => { - let arrayBuffer = new ArrayBuffer(1024 * 1024 * 1024); - ok( - arrayBuffer, - "Successfully allocated a gigabyte of memory in content process" - ); - }); - }); -}); diff --git a/dom/tests/browser/browser_largeAllocation_non_win32.js b/dom/tests/browser/browser_largeAllocation_non_win32.js deleted file mode 100644 index bc3f13ec8920..000000000000 --- a/dom/tests/browser/browser_largeAllocation_non_win32.js +++ /dev/null @@ -1,43 +0,0 @@ -let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/")); -/* import-globals-from helper_largeAllocation.js */ -Services.scriptloader.loadSubScript( - testDir + "/helper_largeAllocation.js", - this -); - -// Force-enabling the Large-Allocation header -add_task(async function() { - info("Test 1 - force enabling the Large-Allocation header"); - await SpecialPowers.pushPrefEnv({ - set: [ - // Enable the header if it is disabled - ["dom.largeAllocationHeader.enabled", true], - // Force-enable process creation with large-allocation, such that non - // win32 builds can test the behavior. - ["dom.largeAllocation.forceEnable", true], - // Increase processCount.webLargeAllocation to avoid any races where - // processes aren't being cleaned up quickly enough. - ["dom.ipc.processCount.webLargeAllocation", 20], - ], - }); - - await largeAllocSuccessTests(); -}); - -add_task(async function() { - info("Test 2 - not force enabling the Large-Allocation header"); - await SpecialPowers.pushPrefEnv({ - set: [ - // Enable the header if it is disabled - ["dom.largeAllocationHeader.enabled", true], - // Force-enable process creation with large-allocation, such that non - // win32 builds can test the behavior. - ["dom.largeAllocation.forceEnable", false], - // Increase processCount.webLargeAllocation to avoid any races where - // processes aren't being cleaned up quickly enough. - ["dom.ipc.processCount.webLargeAllocation", 20], - ], - }); - - await largeAllocFailTests(); -}); diff --git a/dom/tests/browser/browser_largeAllocation_win32.js b/dom/tests/browser/browser_largeAllocation_win32.js deleted file mode 100644 index d45f1585fa6f..000000000000 --- a/dom/tests/browser/browser_largeAllocation_win32.js +++ /dev/null @@ -1,20 +0,0 @@ -let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/")); -Services.scriptloader.loadSubScript( - testDir + "/helper_largeAllocation.js", - this -); - -add_task(async function() { - info("Test 1 - On win32 - no forceEnable pref"); - await SpecialPowers.pushPrefEnv({ - set: [ - // Enable the header if it is disabled - ["dom.largeAllocationHeader.enabled", true], - // Increase processCount.webLargeAllocation to avoid any races where - // processes aren't being cleaned up quickly enough. - ["dom.ipc.processCount.webLargeAllocation", 20], - ], - }); - /* global largeAllocSuccessTests */ - await largeAllocSuccessTests(); -}); diff --git a/dom/tests/browser/helper_largeAllocation.js b/dom/tests/browser/helper_largeAllocation.js deleted file mode 100644 index ec5b4b3158e9..000000000000 --- a/dom/tests/browser/helper_largeAllocation.js +++ /dev/null @@ -1,600 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -const TEST_URI = - "http://example.com/browser/dom/tests/browser/test_largeAllocation.html"; -const TEST_URI_2 = - "http://example.com/browser/dom/tests/browser/test_largeAllocation2.html"; - -function expectProcessCreated() { - let os = Services.obs; - let kill; // A kill function which will disable the promise. - let promise = new Promise((resolve, reject) => { - let topic = "ipc:content-created"; - function observer() { - os.removeObserver(observer, topic); - ok(true, "Expect process created"); - resolve(); - } - os.addObserver(observer, topic); - kill = () => { - os.removeObserver(observer, topic); - ok(true, "Expect process created killed"); - reject(); - }; - }); - promise.kill = kill; - return promise; -} - -function getPID(aBrowser) { - return SpecialPowers.spawn(aBrowser, [], () => { - return Services.appinfo.processID; - }); -} - -function getInLAProc(aBrowser) { - return SpecialPowers.spawn(aBrowser, [], () => { - return Services.appinfo.remoteType == "webLargeAllocation"; - }); -} - -async function largeAllocSuccessTests() { - // I'm terrible and put this set of tests into a single file, so I need a longer timeout - requestLongerTimeout(4); - - // Check if we are on win32 - let isWin32 = - /Windows/.test(navigator.userAgent) && !/x64/.test(navigator.userAgent); - - await SpecialPowers.pushPrefEnv({ - set: [ - // Enable the header if it is disabled - ["dom.largeAllocationHeader.enabled", true], - // Force-enable process creation with large-allocation, such that non - // win32 builds can test the behavior. - ["dom.largeAllocation.forceEnable", !isWin32], - // Increase processCount.webLargeAllocation to avoid any races where - // processes aren't being cleaned up quickly enough. - ["dom.ipc.processCount.webLargeAllocation", 20], - ], - }); - - // A toplevel tab should be able to navigate cross process! - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - info("Starting test 0"); - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - let ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - // Wait for the new process to be created - await ready; - - let pid2 = await getPID(aBrowser); - - isnot( - pid1, - pid2, - "The pids should be different between the initial load and the new load" - ); - is(true, await getInLAProc(aBrowser)); - }); - - // When a Large-Allocation document is loaded in an iframe, the header should - // be ignored, and the tab should stay in the current process. - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - info("Starting test 1"); - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - // eslint-disable-next-line no-unsanitized/property - content.document.body.innerHTML = ``; - - return new Promise(resolve => { - content.document.body.querySelector("iframe").onload = () => { - ok(true, "Iframe finished loading"); - resolve(); - }; - }); - }); - - let pid2 = await getPID(aBrowser); - - is(pid1, pid2, "The PID should not have changed"); - is(false, await getInLAProc(aBrowser)); - }); - - // If you have an opener cross process navigation shouldn't work - await BrowserTestUtils.withNewTab("http://example.com", async function( - aBrowser - ) { - info("Starting test 2"); - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - info(TEST_URI); - content.document.body.innerHTML = ""; - - return new Promise(resolve => { - let w = content.window.open(TEST_URI, "_blank"); - w.onload = () => { - ok(true, "Window finished loading"); - w.close(); - resolve(); - }; - }); - }); - - let pid2 = await getPID(aBrowser); - - is(pid1, pid2, "The PID should not have changed"); - is(false, await getInLAProc(aBrowser)); - }); - - // Load Large-Allocation twice with example.com load in between - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - info("Starting test 3"); - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - let ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - await ready; - - let pid2 = await getPID(aBrowser); - - isnot(pid1, pid2); - is(true, await getInLAProc(aBrowser)); - - await SpecialPowers.spawn(aBrowser, [], () => { - content.document.location = "http://example.com"; - }); - - await BrowserTestUtils.browserLoaded(aBrowser); - - // We should have been kicked out of the large-allocation process by the - // load, meaning we're back in a non-fresh process - is(false, await getInLAProc(aBrowser)); - - ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - await ready; - - let pid4 = await getPID(aBrowser); - - isnot(pid1, pid4); - isnot(pid2, pid4); - is(true, await getInLAProc(aBrowser)); - }); - - // Load Large-Allocation then example.com load, then back button press should load from bfcache. - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - info("Starting test 4"); - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - let ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - await ready; - - let pid2 = await getPID(aBrowser); - - isnot(pid1, pid2, "PIDs 1 and 2 should not match"); - is(true, await getInLAProc(aBrowser)); - - // Switch to about:blank, so we can navigate back - await SpecialPowers.spawn(aBrowser, [], () => { - content.document.location = "http://example.com"; - }); - - await BrowserTestUtils.browserLoaded(aBrowser); - - let pid3 = await getPID(aBrowser); - - // We should have been kicked out of the large-allocation process by the - // load, meaning we're back in a non-large-allocation process. - is(false, await getInLAProc(aBrowser)); - - ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - - // Navigate back to the previous page. As the large alloation process was - // left, it won't be in bfcache and will have to be loaded fresh. - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.window.history.back(); - }); - - await ready; - - let pid4 = await getPID(aBrowser); - - isnot(pid1, pid4, "PID 4 shouldn't match PID 1"); - isnot(pid2, pid4, "PID 4 shouldn't match PID 2"); - isnot(pid3, pid4, "PID 4 shouldn't match PID 3"); - is(true, await getInLAProc(aBrowser)); - }); - - // Two consecutive large-allocation loads should create two processes. - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - info("Starting test 5"); - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - let ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - await ready; - - let pid2 = await getPID(aBrowser); - - isnot(pid1, pid2, "PIDs 1 and 2 should not match"); - is(true, await getInLAProc(aBrowser)); - - ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - - await SpecialPowers.spawn(aBrowser, [TEST_URI_2], TEST_URI_2 => { - content.document.location = TEST_URI_2; - }); - - await ready; - - let pid3 = await getPID(aBrowser); - - isnot(pid1, pid3, "PIDs 1 and 3 should not match"); - isnot(pid2, pid3, "PIDs 2 and 3 should not match"); - is(true, await getInLAProc(aBrowser)); - }); - - // Opening a window from the large-allocation window should prevent the process switch. - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - info("Starting test 6"); - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - let ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - await ready; - - let pid2 = await getPID(aBrowser); - - isnot(pid1, pid2, "PIDs 1 and 2 should not match"); - is(true, await getInLAProc(aBrowser)); - - let promiseTabOpened = BrowserTestUtils.waitForNewTab( - gBrowser, - "about:blank" - ); - await SpecialPowers.spawn(aBrowser, [], () => { - content.window.open("about:blank"); - content.document.location = "http://example.com"; - }); - - await BrowserTestUtils.browserLoaded(aBrowser); - - let pid3 = await getPID(aBrowser); - - is(pid3, pid2, "PIDs 2 and 3 should match"); - is(true, await getInLAProc(aBrowser)); - - BrowserTestUtils.removeTab(await promiseTabOpened); - }); - - // Opening a window from the large-allocation window should prevent the - // process switch with reload. - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - info("Starting test 6a"); - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - let ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - await ready; - - let pid2 = await getPID(aBrowser); - - isnot(pid1, pid2, "PIDs 1 and 2 should not match"); - is(true, await getInLAProc(aBrowser)); - - let firstTab = gBrowser.selectedTab; - let promiseTabOpened = BrowserTestUtils.waitForNewTab( - gBrowser, - "about:blank" - ); - await SpecialPowers.spawn(aBrowser, [], () => { - content.window.open("about:blank"); - }); - let newTab = await promiseTabOpened; - - if (firstTab != gBrowser.selectedTab) { - firstTab = await BrowserTestUtils.switchTab(gBrowser, firstTab); - aBrowser = firstTab.linkedBrowser; - } - let promiseLoad = BrowserTestUtils.browserLoaded(aBrowser); - document.getElementById("reload-button").doCommand(); - await promiseLoad; - - let pid3 = await getPID(aBrowser); - - is(pid3, pid2, "PIDs 2 and 3 should match"); - is(true, await getInLAProc(aBrowser)); - - BrowserTestUtils.removeTab(newTab); - }); - - // Try dragging the tab into a new window when not at the maximum number of - // Large-Allocation processes. - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - info("Starting test 7"); - - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - let ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - await ready; - - let pid2 = await getPID(aBrowser); - - isnot(pid1, pid2, "PIDs 1 and 2 should not match"); - is(true, await getInLAProc(aBrowser)); - - let newWindow = await BrowserTestUtils.openNewBrowserWindow(); - - newWindow.gBrowser.adoptTab( - gBrowser.getTabForBrowser(aBrowser), - 0, - null, - Services.scriptSecurityManager.getSystemPrincipal() - ); - let newTab = newWindow.gBrowser.tabs[0]; - - is(newTab.linkedBrowser.currentURI.spec, TEST_URI); - is(newTab.linkedBrowser.remoteType, "webLargeAllocation"); - let pid3 = await getPID(newTab.linkedBrowser); - - is(pid2, pid3, "PIDs 2 and 3 should match"); - is(true, await getInLAProc(newTab.linkedBrowser)); - - await BrowserTestUtils.closeWindow(newWindow); - }); - - // Try opening a new Large-Allocation document when at the max number of large - // allocation processes. - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - info("Starting test 8"); - await SpecialPowers.pushPrefEnv({ - set: [["dom.ipc.processCount.webLargeAllocation", 1]], - }); - - // Loading the first Large-Allocation tab should succeed as normal - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - let ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - await ready; - - let pid2 = await getPID(aBrowser); - - isnot(pid1, pid2, "PIDs 1 and 2 should not match"); - is(true, await getInLAProc(aBrowser)); - - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - // The second one should load in a non-LA proc because the - // webLargeAllocation processes have been exhausted. - is(false, await getInLAProc(aBrowser)); - - let ready = Promise.all([BrowserTestUtils.browserLoaded(aBrowser)]); - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - await ready; - - is(false, await getInLAProc(aBrowser)); - }); - }); - - // XXX: Important - reset the process count, as it was set to 1 by the - // previous test. - await SpecialPowers.pushPrefEnv({ - set: [["dom.ipc.processCount.webLargeAllocation", 20]], - }); - - // view-source tabs should not be considered to be in a large-allocation process. - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - info("Starting test 9"); - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - await SpecialPowers.spawn(aBrowser, [], () => { - content.document.location = "view-source:http://example.com"; - }); - - await BrowserTestUtils.browserLoaded(aBrowser); - - let pid2 = await getPID(aBrowser); - - is(pid1, pid2, "The PID should not have changed"); - is(false, await getInLAProc(aBrowser)); - }); - - // Try dragging tab into new window when at the max number of large allocation - // processes. - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - info("Starting test 10"); - await SpecialPowers.pushPrefEnv({ - set: [["dom.ipc.processCount.webLargeAllocation", 1]], - }); - - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - let ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - await ready; - - let pid2 = await getPID(aBrowser); - - isnot(pid1, pid2, "PIDs 1 and 2 should not match"); - is(true, await getInLAProc(aBrowser)); - - let newWindow = await BrowserTestUtils.openNewBrowserWindow(); - - newWindow.gBrowser.adoptTab(gBrowser.getTabForBrowser(aBrowser), 0); - let newTab = newWindow.gBrowser.tabs[0]; - - is(newTab.linkedBrowser.currentURI.spec, TEST_URI); - is(newTab.linkedBrowser.remoteType, "webLargeAllocation"); - let pid3 = await getPID(newTab.linkedBrowser); - - is(pid2, pid3, "PIDs 2 and 3 should match"); - is(true, await getInLAProc(newTab.linkedBrowser)); - - await BrowserTestUtils.closeWindow(newWindow); - }); - - // XXX: Important - reset the process count, as it was set to 1 by the - // previous test. - await SpecialPowers.pushPrefEnv({ - set: [["dom.ipc.processCount.webLargeAllocation", 20]], - }); - - await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) { - info("Starting test 11"); - - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - let ready = Promise.all([ - expectProcessCreated(), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - await ready; - - let pid2 = await getPID(aBrowser); - - isnot(pid1, pid2, "PIDs 1 and 2 should not match"); - is(true, await getInLAProc(aBrowser)); - - await Promise.all([ - SpecialPowers.spawn(aBrowser, [], () => { - content.document.querySelector("#submit").click(); - }), - BrowserTestUtils.browserLoaded(aBrowser), - ]); - - let innerText = await SpecialPowers.spawn(aBrowser, [], () => { - return content.document.body.innerText; - }); - isnot(innerText, "FAIL", "We should not have sent a get request!"); - is( - innerText, - "textarea=default+value&button=submit", - "The post data should be received by the callee" - ); - }); - - // XXX: Make sure to reset dom.ipc.processCount.webLargeAllocation if adding a - // test after the above test. -} - -async function largeAllocFailTests() { - await BrowserTestUtils.withNewTab("http://example.com", async function( - aBrowser - ) { - info("Starting test 1"); - let pid1 = await getPID(aBrowser); - is(false, await getInLAProc(aBrowser)); - - await SpecialPowers.spawn(aBrowser, [TEST_URI], TEST_URI => { - content.document.location = TEST_URI; - }); - - await BrowserTestUtils.browserLoaded(aBrowser); - - let pid2 = await getPID(aBrowser); - - is(pid1, pid2, "The PID should not have changed"); - is(false, await getInLAProc(aBrowser)); - }); -} diff --git a/dom/tests/browser/test_largeAllocation.html b/dom/tests/browser/test_largeAllocation.html deleted file mode 100644 index 047059a2fdf1..000000000000 --- a/dom/tests/browser/test_largeAllocation.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Loaded in a new process! -
- - -
- - diff --git a/dom/tests/browser/test_largeAllocation.html^headers^ b/dom/tests/browser/test_largeAllocation.html^headers^ deleted file mode 100644 index 672836b61ecf..000000000000 --- a/dom/tests/browser/test_largeAllocation.html^headers^ +++ /dev/null @@ -1 +0,0 @@ -Large-Allocation: 0 \ No newline at end of file diff --git a/dom/tests/browser/test_largeAllocation2.html b/dom/tests/browser/test_largeAllocation2.html deleted file mode 100644 index 3a117af8103a..000000000000 --- a/dom/tests/browser/test_largeAllocation2.html +++ /dev/null @@ -1,4 +0,0 @@ - - - Loaded in a new process! - diff --git a/dom/tests/browser/test_largeAllocation2.html^headers^ b/dom/tests/browser/test_largeAllocation2.html^headers^ deleted file mode 100644 index 672836b61ecf..000000000000 --- a/dom/tests/browser/test_largeAllocation2.html^headers^ +++ /dev/null @@ -1 +0,0 @@ -Large-Allocation: 0 \ No newline at end of file diff --git a/dom/tests/browser/test_largeAllocationFormSubmit.sjs b/dom/tests/browser/test_largeAllocationFormSubmit.sjs deleted file mode 100644 index 4238942684b5..000000000000 --- a/dom/tests/browser/test_largeAllocationFormSubmit.sjs +++ /dev/null @@ -1,27 +0,0 @@ -const BinaryInputStream = Components.Constructor( - "@mozilla.org/binaryinputstream;1", - "nsIBinaryInputStream", - "setInputStream" -); - -function handleRequest(request, response) { - response.setHeader("Large-Allocation", "0", false); - response.setHeader("Content-Type", "text/plain", false); - response.setStatusLine(request.httpVersion, "200", "Found"); - if (request.method == "GET") { - response.write("FAIL"); - return; - } - - var body = new BinaryInputStream(request.bodyInputStream); - - var avail; - var bytes = []; - - while ((avail = body.available()) > 0) { - Array.prototype.push.apply(bytes, body.readByteArray(avail)); - } - - var data = String.fromCharCode.apply(null, bytes); - response.bodyOutputStream.write(data, data.length); -} diff --git a/dom/workers/remoteworkers/RemoteWorkerManager.cpp b/dom/workers/remoteworkers/RemoteWorkerManager.cpp index 7ede1b71adc5..d9c266f68313 100644 --- a/dom/workers/remoteworkers/RemoteWorkerManager.cpp +++ b/dom/workers/remoteworkers/RemoteWorkerManager.cpp @@ -98,10 +98,6 @@ bool RemoteWorkerManager::MatchRemoteType(const nsACString& processRemoteType, // remoteType and here we can just assert that it is not happening. MOZ_ASSERT(!IsWebCoopCoepRemoteType(workerRemoteType)); - // For similar reasons to the ones related to COOP+COEP processes, - // we don't expect workerRemoteType to be set to a large allocation one. - MOZ_ASSERT(workerRemoteType != LARGE_ALLOCATION_REMOTE_TYPE); - return processRemoteType.Equals(workerRemoteType); } diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 8012aba9b81b..0b8bd1eeb220 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -2742,17 +2742,6 @@ value: true mirror: always -# Whether the Large-Allocation header is enabled. -- name: dom.largeAllocationHeader.enabled - type: bool - value: true - mirror: always - -- name: dom.largeAllocation.forceEnable - type: bool - value: false - mirror: always - # Whether "W3C Web Manifest" processing is enabled - name: dom.manifest.enabled type: bool diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 651d38c0e246..39747e7de50b 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -2489,9 +2489,6 @@ pref("dom.ipc.keepProcessesAlive.privilegedabout", 1); // Disable support for SVG pref("svg.disabled", false); -// Override default dom.ipc.processCount for some remote content process types. -pref("dom.ipc.processCount.webLargeAllocation", 10); - // Disable e10s for Gecko by default. This is overridden in firefox.js. pref("browser.tabs.remote.autostart", false); diff --git a/toolkit/components/aboutprocesses/content/aboutProcesses.js b/toolkit/components/aboutprocesses/content/aboutProcesses.js index ba61de2a1b1d..24605fc79685 100644 --- a/toolkit/components/aboutprocesses/content/aboutProcesses.js +++ b/toolkit/components/aboutprocesses/content/aboutProcesses.js @@ -468,10 +468,6 @@ var View = { fluentName = "about-processes-web-serviceworker"; fluentArgs.origin = data.origin; break; - case "webLargeAllocation": - fluentName = "about-processes-web-large-allocation-process"; - fluentArgs.origin = data.origin; - break; case "file": fluentName = "about-processes-file-process"; break; @@ -1341,7 +1337,6 @@ var Control = { // Web content comes next. case "webIsolated": case "webServiceWorker": - case "webLargeAllocation": case "withCoopCoep": { if (windows.some(w => w.tab)) { return RANK_WEB_TABS; diff --git a/toolkit/components/processtools/ProcInfo.h b/toolkit/components/processtools/ProcInfo.h index b100c4038d4d..82cfb63e379c 100644 --- a/toolkit/components/processtools/ProcInfo.h +++ b/toolkit/components/processtools/ProcInfo.h @@ -45,7 +45,6 @@ enum class ProcType { Extension, PrivilegedAbout, PrivilegedMozilla, - WebLargeAllocation, WebCOOPCOEP, WebServiceWorker, // the rest matches GeckoProcessTypes.h diff --git a/toolkit/locales/en-US/toolkit/about/aboutProcesses.ftl b/toolkit/locales/en-US/toolkit/about/aboutProcesses.ftl index a3f4d2f8d069..77e8cc3ea09b 100644 --- a/toolkit/locales/en-US/toolkit/about/aboutProcesses.ftl +++ b/toolkit/locales/en-US/toolkit/about/aboutProcesses.ftl @@ -65,10 +65,8 @@ about-processes-unknown-process = Other: { $type } ({ $pid }) about-processes-web-isolated-process = { $origin } ({ $pid }) about-processes-web-serviceworker = { $origin } ({ $pid }, serviceworker) -about-processes-web-large-allocation-process = { $origin } ({ $pid }, large) about-processes-with-coop-coep-process = { $origin } ({ $pid }, cross-origin isolated) about-processes-web-isolated-process-private = { $origin } — Private ({ $pid }) -about-processes-web-large-allocation-process-private = { $origin } — Private ({ $pid }, large) about-processes-with-coop-coep-process-private = { $origin } — Private ({ $pid }, cross-origin isolated) ## Details within processes diff --git a/toolkit/locales/en-US/toolkit/global/processTypes.ftl b/toolkit/locales/en-US/toolkit/global/processTypes.ftl index f62a1d842eb5..db48ec250b48 100644 --- a/toolkit/locales/en-US/toolkit/global/processTypes.ftl +++ b/toolkit/locales/en-US/toolkit/global/processTypes.ftl @@ -21,10 +21,6 @@ process-type-extension = Extension # process used to open file:// URLs process-type-file = Local File -# process used to isolate webpages that requested special -# permission to allocate large amounts of memory -process-type-weblargeallocation = Large Allocation - # process used to isolate a webpage from other web pages # to improve security process-type-webisolated = Isolated Web Content diff --git a/toolkit/modules/E10SUtils.jsm b/toolkit/modules/E10SUtils.jsm index be7503df1ed1..de42585bd82c 100644 --- a/toolkit/modules/E10SUtils.jsm +++ b/toolkit/modules/E10SUtils.jsm @@ -80,7 +80,6 @@ const PRIVILEGEDMOZILLA_REMOTE_TYPE = "privilegedmozilla"; const SERVICEWORKER_REMOTE_TYPE = "webServiceWorker"; // This must start with the WEB_REMOTE_TYPE above. -const LARGE_ALLOCATION_REMOTE_TYPE = "webLargeAllocation"; const DEFAULT_REMOTE_TYPE = WEB_REMOTE_TYPE; // This list is duplicated between Navigator.cpp and here because navigator @@ -274,7 +273,6 @@ var E10SUtils = { EXTENSION_REMOTE_TYPE, PRIVILEGEDABOUT_REMOTE_TYPE, PRIVILEGEDMOZILLA_REMOTE_TYPE, - LARGE_ALLOCATION_REMOTE_TYPE, FISSION_WEB_REMOTE_TYPE, SERVICEWORKER_REMOTE_TYPE, @@ -662,17 +660,10 @@ var E10SUtils = { return NOT_REMOTE; } - if ( - // We don't want to launch workers in a large allocation remote type, - // change it to the web remote type (then getRemoteTypeForURIObject - // may change it to an isolated one). - aPreferredRemoteType === LARGE_ALLOCATION_REMOTE_TYPE || - // Similarly to the large allocation remote type, we don't want to - // launch the shared worker in a web coop+coep remote type even if - // was registered from a frame loaded in a child process with that - // remote type. - aPreferredRemoteType?.startsWith(WEB_REMOTE_COOP_COEP_TYPE_PREFIX) - ) { + // We don't want to launch the shared worker in a web coop+coep remote type + // even if was registered from a frame loaded in a child process with that + // remote type. + if (aPreferredRemoteType?.startsWith(WEB_REMOTE_COOP_COEP_TYPE_PREFIX)) { aPreferredRemoteType = DEFAULT_REMOTE_TYPE; } diff --git a/toolkit/modules/ProcessType.jsm b/toolkit/modules/ProcessType.jsm index e9c4ce1dd2b3..8fe25555d2cc 100644 --- a/toolkit/modules/ProcessType.jsm +++ b/toolkit/modules/ProcessType.jsm @@ -28,7 +28,6 @@ const ProcessType = Object.freeze({ web: "process-type-web", webIsolated: "process-type-webisolated", webServiceWorker: "process-type-webserviceworker", - webLargeAllocation: "process-type-weblargeallocation", }, kFallback: "process-type-unknown", diff --git a/toolkit/modules/tests/xpcshell/test_E10SUtils_workers_remote_types.js b/toolkit/modules/tests/xpcshell/test_E10SUtils_workers_remote_types.js index e0b457a038b1..78d08a2f25b5 100644 --- a/toolkit/modules/tests/xpcshell/test_E10SUtils_workers_remote_types.js +++ b/toolkit/modules/tests/xpcshell/test_E10SUtils_workers_remote_types.js @@ -40,7 +40,6 @@ const { EXTENSION_REMOTE_TYPE, FILE_REMOTE_TYPE, FISSION_WEB_REMOTE_TYPE, - LARGE_ALLOCATION_REMOTE_TYPE, NOT_REMOTE, PRIVILEGEDABOUT_REMOTE_TYPE, PRIVILEGEDMOZILLA_REMOTE_TYPE, @@ -54,7 +53,8 @@ const { REMOTE_WORKER_TYPE_SERVICE, } = Ci.nsIE10SUtils; -// Test ServiceWorker remoteType selection with multiprocess and/or site isolation enabled. +// Test ServiceWorker remoteType selection with multiprocess and/or site +// isolation enabled. add_task(function test_get_remote_type_for_service_worker() { // ServiceWorkers with system or null principal are unexpected and we expect // the method call to throw. @@ -146,12 +146,12 @@ add_task(function test_get_remote_type_for_service_worker() { } }); -// Test SharedWorker remoteType selection with multiprocess and/or site isolation enabled. +// Test SharedWorker remoteType selection with multiprocess and/or site +// isolation enabled. add_task(function test_get_remote_type_for_shared_worker() { - // Verify that for shared worker registered from a large allocation or web - // coop+coep remote types we are going to select a web or fission remote type. + // Verify that for shared worker registered from a web coop+coep remote type + // we are going to select a web or fission remote type. for (const [principal, preferredRemoteType] of [ - [principalSecureCom, LARGE_ALLOCATION_REMOTE_TYPE], [ principalSecureCom, `${WEB_REMOTE_COOP_COEP_TYPE_PREFIX}=${principalSecureCom.siteOrigin}`, @@ -245,7 +245,6 @@ add_task(function test_get_remote_type_for_shared_worker() { // Shared worker registered for web+custom urls. for (const [preferredRemoteType, expectedRemoteType] of [ [WEB_REMOTE_TYPE, WEB_REMOTE_TYPE], - [LARGE_ALLOCATION_REMOTE_TYPE, WEB_REMOTE_TYPE], ["fakeRemoteType", "fakeRemoteType"], // This seems to be actually failing with a SecurityError // as soon as the SharedWorker constructor is being called with @@ -269,7 +268,6 @@ add_task(function test_get_remote_type_for_shared_worker() { // Shared worker registered for ext+custom urls. for (const [preferredRemoteType, expectedRemoteType] of [ [WEB_REMOTE_TYPE, WEB_REMOTE_TYPE], - [LARGE_ALLOCATION_REMOTE_TYPE, WEB_REMOTE_TYPE], ["fakeRemoteType", "fakeRemoteType"], // This seems to be actually prevented by failing a ClientIsValidPrincipalInfo // check (but only when the remote worker is being launched in the child process