Backed out changeset 37b9e5af6540 (bug 1670244) for causing android xpcshell crashes in test_ext_file_access.js

This commit is contained in:
Alexandru Michis 2021-03-29 21:26:05 +03:00
Родитель 86469c9679
Коммит 0f7ba7cb4b
3 изменённых файлов: 2 добавлений и 26 удалений

Просмотреть файл

@ -1354,26 +1354,6 @@ IPCResult BrowserParent::RecvNewWindowGlobal(
return IPC_FAIL(this, "Cannot create without valid principal");
}
// Ensure we never load a document with a content principal in
// the wrong type of webIsolated process
EnumSet<ContentParent::ValidatePrincipalOptions> validationOptions = {};
nsCOMPtr<nsIURI> docURI = aInit.documentURI();
if (docURI->SchemeIs("about") || docURI->SchemeIs("chrome")) {
// XXXckerschb TODO - Do not use SystemPrincipal for:
// Bug 1700639: about:plugins
// Bug 1698087: chrome://devtools/content/shared/webextension-fallback.html
// chrome reftests, e.g.
// * chrome://reftest/content/writing-mode/ua-style-sheet-button-1a-ref.html
// * chrome://reftest/content/xul-document-load/test003.xhtml
// * chrome://reftest/content/forms/input/text/centering-1.xhtml
validationOptions = {ContentParent::ValidatePrincipalOptions::AllowSystem};
}
if (!mManager->ValidatePrincipal(aInit.principal(), validationOptions)) {
ContentParent::LogAndAssertFailedPrincipalValidationInfo(aInit.principal(),
__func__);
}
// Construct our new WindowGlobalParent, bind, and initialize it.
RefPtr<WindowGlobalParent> wgp =
WindowGlobalParent::CreateDisconnected(aInit);

Просмотреть файл

@ -1300,9 +1300,8 @@ mozilla::ipc::IPCResult ContentParent::RecvUngrabPointer(
Atomic<bool, mozilla::Relaxed> sContentParentTelemetryEventEnabled(false);
/*static*/
void ContentParent::LogAndAssertFailedPrincipalValidationInfo(
nsIPrincipal* aPrincipal, const char* aMethod) {
static void LogAndAssertFailedPrincipalValidationInfo(nsIPrincipal* aPrincipal,
const char* aMethod) {
// nsContentSecurityManager may also enable this same event, but that's okay
if (!sContentParentTelemetryEventEnabled.exchange(true)) {
sContentParentTelemetryEventEnabled = true;

Просмотреть файл

@ -173,9 +173,6 @@ class ContentParent final
static void ReleaseCachedProcesses();
static void LogAndAssertFailedPrincipalValidationInfo(
nsIPrincipal* aPrincipal, const char* aMethod);
/**
* Picks a random content parent from |aContentParents| respecting the index
* limit set by |aMaxContentParents|.