From 8197ed228b6a11e38d112d890d2c700121aee223 Mon Sep 17 00:00:00 2001 From: Ciure Andrei Date: Fri, 22 Mar 2019 15:43:00 +0200 Subject: [PATCH] Backed out changeset 99b6adafbfa3 (bug 1523609) for causing nsCOMPtr asertion failures and nsIAppStartup failures CLOSED TREE --- browser/extensions/formautofill/api.js | 6 +----- .../webcompat-reporter/experimentalAPIs/l10n.js | 2 +- chrome/nsChromeRegistryChrome.cpp | 7 ------- toolkit/components/startup/public/nsIAppStartup.idl | 5 +++-- toolkit/mozapps/extensions/AddonManagerStartup.cpp | 9 --------- 5 files changed, 5 insertions(+), 24 deletions(-) diff --git a/browser/extensions/formautofill/api.js b/browser/extensions/formautofill/api.js index 897cfb5faded..ab41f33f0402 100644 --- a/browser/extensions/formautofill/api.js +++ b/browser/extensions/formautofill/api.js @@ -130,11 +130,7 @@ this.formautofill = class extends ExtensionAPI { Services.mm.loadFrameScript("chrome://formautofill/content/FormAutofillFrameScript.js", true, true); } - onShutdown(reason) { - if (reason == "APP_SHUTDOWN") { - return; - } - + onShutdown() { resProto.setSubstitution(RESOURCE_HOST, null); this.chromeHandle.destruct(); diff --git a/browser/extensions/webcompat-reporter/experimentalAPIs/l10n.js b/browser/extensions/webcompat-reporter/experimentalAPIs/l10n.js index e01e87cb9896..830a1c8297d4 100644 --- a/browser/extensions/webcompat-reporter/experimentalAPIs/l10n.js +++ b/browser/extensions/webcompat-reporter/experimentalAPIs/l10n.js @@ -17,7 +17,7 @@ let l10nManifest; this.l10n = class extends ExtensionAPI { onShutdown(reason) { - if (reason !== "APP_SHUTDOWN" && l10nManifest) { + if (l10nManifest) { Components.manager.removeBootstrappedManifestLocation(l10nManifest); } } diff --git a/chrome/nsChromeRegistryChrome.cpp b/chrome/nsChromeRegistryChrome.cpp index 195b57e42018..ea71f8f6acdd 100644 --- a/chrome/nsChromeRegistryChrome.cpp +++ b/chrome/nsChromeRegistryChrome.cpp @@ -28,7 +28,6 @@ #include "mozilla/Unused.h" #include "mozilla/intl/LocaleService.h" -#include "nsIAppStartup.h" #include "nsIObserverService.h" #include "nsIPrefBranch.h" #include "nsIPrefService.h" @@ -274,12 +273,6 @@ nsChromeRegistryChrome::Observe(nsISupports* aSubject, const char* aTopic, NS_IMETHODIMP nsChromeRegistryChrome::CheckForNewChrome() { - nsCOMPtr appStartup = components::AppStartup::Service(); - if (appStartup->GetShuttingDown()) { - MOZ_ASSERT(false, "checking for new chrome during shutdown"); - return NS_ERROR_UNEXPECTED; - } - mPackagesHash.Clear(); mOverrideTable.Clear(); diff --git a/toolkit/components/startup/public/nsIAppStartup.idl b/toolkit/components/startup/public/nsIAppStartup.idl index c4cf94283c00..e7150346ce1b 100644 --- a/toolkit/components/startup/public/nsIAppStartup.idl +++ b/toolkit/components/startup/public/nsIAppStartup.idl @@ -7,7 +7,8 @@ interface nsIToolkitProfile; -[scriptable, builtinclass, uuid(6621f6d5-6c04-4a0e-9e74-447db221484e)] +[scriptable, uuid(6621f6d5-6c04-4a0e-9e74-447db221484e)] + interface nsIAppStartup : nsISupports { /** @@ -141,7 +142,7 @@ interface nsIAppStartup : nsISupports /** * True if the application is in the process of shutting down. */ - [infallible] readonly attribute boolean shuttingDown; + readonly attribute boolean shuttingDown; /** * True if the application is in the process of starting up. diff --git a/toolkit/mozapps/extensions/AddonManagerStartup.cpp b/toolkit/mozapps/extensions/AddonManagerStartup.cpp index d89a2c3bbc88..5fb0d250a7ed 100644 --- a/toolkit/mozapps/extensions/AddonManagerStartup.cpp +++ b/toolkit/mozapps/extensions/AddonManagerStartup.cpp @@ -15,7 +15,6 @@ #include "mozilla/ClearOnShutdown.h" #include "mozilla/EndianUtils.h" -#include "mozilla/Components.h" #include "mozilla/Compression.h" #include "mozilla/LinkedList.h" #include "mozilla/Preferences.h" @@ -31,7 +30,6 @@ #include "nsAppRunner.h" #include "nsContentUtils.h" #include "nsChromeRegistry.h" -#include "nsIAppStartup.h" #include "nsIDOMWindowUtils.h" // for nsIJSRAIIHelper #include "nsIFileURL.h" #include "nsIIOService.h" @@ -694,13 +692,6 @@ RegistryEntries::Destruct() { if (isInList()) { remove(); - // No point in doing I/O to check for new chrome during shutdown, return - // early in that case. - nsCOMPtr appStartup = components::AppStartup::Service(); - if (appStartup->GetShuttingDown()) { - return NS_OK; - } - // When we remove dynamic entries from the registry, we need to rebuild it // in order to ensure a consistent state. See comments in Observe(). RefPtr cr = nsChromeRegistry::GetSingleton();