diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp index bb8b5a01ddcc..6d4c4c8c4f6b 100644 --- a/xpcom/build/XPCOMInit.cpp +++ b/xpcom/build/XPCOMInit.cpp @@ -40,8 +40,6 @@ #include "nsDebugImpl.h" #include "nsSystemInfo.h" -#include "nsINIParserImpl.h" - #include "nsComponentManager.h" #include "nsCategoryManagerUtils.h" #include "nsIServiceManager.h" @@ -153,30 +151,6 @@ mozilla::Atomic gXPCOMThreadsShutDown( bool gXPCOMMainThreadEventsAreDoomed = false; char16_t* gGREBinPath = nullptr; -static NS_DEFINE_CID(kINIParserFactoryCID, NS_INIPARSERFACTORY_CID); - -static already_AddRefed CreateINIParserFactory( - const mozilla::Module& aModule, const mozilla::Module::CIDEntry& aEntry) { - nsCOMPtr f = new nsINIParserFactory(); - return f.forget(); -} - -const mozilla::Module::CIDEntry kXPCOMCIDEntries[] = { - {&kINIParserFactoryCID, false, CreateINIParserFactory}, {nullptr}}; - -const mozilla::Module::ContractIDEntry kXPCOMContracts[] = { - {NS_INIPARSERFACTORY_CONTRACTID, &kINIParserFactoryCID}, {nullptr}}; - -const mozilla::Module kXPCOMModule = { - mozilla::Module::kVersion, - kXPCOMCIDEntries, - kXPCOMContracts, - nullptr, - nullptr, - nullptr, - nullptr, - mozilla::Module::ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS}; - // gDebug will be freed during shutdown. static nsIDebug2* gDebug = nullptr; diff --git a/xpcom/build/components.conf b/xpcom/build/components.conf index b305d3ad82a2..186f7be12c0d 100644 --- a/xpcom/build/components.conf +++ b/xpcom/build/components.conf @@ -228,6 +228,13 @@ Classes = [ 'type': 'nsVersionComparatorImpl', 'headers': ['/xpcom/base/nsVersionComparatorImpl.h'], }, + { + 'cid': '{dfac10a9-dd24-43cf-a095-6ffa2e4b6a6c}', + 'contract_ids': ['@mozilla.org/xpcom/ini-parser-factory;1'], + 'type': 'nsINIParserFactory', + 'headers': ['/xpcom/ds/nsINIParserImpl.h'], + 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS, + }, ] if buildconfig.substs['OS_ARCH'] == 'WINNT': diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index 58f77e31cbe4..abfd54d4dde4 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -361,7 +361,6 @@ nsresult nsComponentManagerImpl::Init() { nsCategoryManager::GetSingleton()->SuppressNotifications(true); - RegisterModule(&kXPCOMModule); RegisterModule(&kNeckoModule); RegisterModule(&kPowerManagerModule); RegisterModule(&kContentProcessWidgetModule); diff --git a/xpcom/components/nsComponentManager.h b/xpcom/components/nsComponentManager.h index af7e80ce3182..dde5a2d5fb59 100644 --- a/xpcom/components/nsComponentManager.h +++ b/xpcom/components/nsComponentManager.h @@ -51,8 +51,6 @@ struct PRThread; //////////////////////////////////////////////////////////////////////////////// -extern const mozilla::Module kXPCOMModule; - namespace { class EntryWrapper; } // namespace diff --git a/xpcom/ds/nsINIParserImpl.cpp b/xpcom/ds/nsINIParserImpl.cpp index 2de0e5c36f3d..b4a8237b0f19 100644 --- a/xpcom/ds/nsINIParserImpl.cpp +++ b/xpcom/ds/nsINIParserImpl.cpp @@ -26,7 +26,7 @@ class nsINIParserImpl final : public nsIINIParser, public nsIINIParserWriter { bool ContainsNull(const nsACString& aStr); }; -NS_IMPL_ISUPPORTS(nsINIParserFactory, nsIINIParserFactory, nsIFactory) +NS_IMPL_ISUPPORTS(nsINIParserFactory, nsIINIParserFactory) NS_IMETHODIMP nsINIParserFactory::CreateINIParser(nsIFile* aINIFile, nsIINIParser** aResult) { @@ -45,12 +45,6 @@ nsINIParserFactory::CreateINIParser(nsIFile* aINIFile, nsIINIParser** aResult) { return NS_OK; } -NS_IMETHODIMP -nsINIParserFactory::CreateInstance(REFNSIID aIID, void** aResult) { - // We are our own singleton. - return QueryInterface(aIID, aResult); -} - NS_IMPL_ISUPPORTS(nsINIParserImpl, nsIINIParser, nsIINIParserWriter) bool nsINIParserImpl::ContainsNull(const nsACString& aStr) { diff --git a/xpcom/ds/nsINIParserImpl.h b/xpcom/ds/nsINIParserImpl.h index c52046447f51..1a60fd107162 100644 --- a/xpcom/ds/nsINIParserImpl.h +++ b/xpcom/ds/nsINIParserImpl.h @@ -8,25 +8,16 @@ #define nsINIParserImpl_h__ #include "nsIINIParser.h" -#include "nsIFactory.h" #include "mozilla/Attributes.h" -#define NS_INIPARSERFACTORY_CID \ - { \ - 0xdfac10a9, 0xdd24, 0x43cf, { \ - 0xa0, 0x95, 0x6f, 0xfa, 0x2e, 0x4b, 0x6a, 0x6c \ - } \ - } - #define NS_INIPARSERFACTORY_CONTRACTID "@mozilla.org/xpcom/ini-parser-factory;1" -class nsINIParserFactory final : public nsIINIParserFactory, public nsIFactory { +class nsINIParserFactory final : public nsIINIParserFactory { ~nsINIParserFactory() = default; public: NS_DECL_ISUPPORTS NS_DECL_NSIINIPARSERFACTORY - NS_DECL_NSIFACTORY }; #endif // nsINIParserImpl_h__