diff --git a/chrome/nsChromeProtocolHandler.cpp b/chrome/nsChromeProtocolHandler.cpp index 04d996aad624..aff357c4fc81 100644 --- a/chrome/nsChromeProtocolHandler.cpp +++ b/chrome/nsChromeProtocolHandler.cpp @@ -9,6 +9,7 @@ */ #include "nsChromeProtocolHandler.h" +#include "mozilla/Components.h" #include "nsChromeRegistry.h" #include "nsCOMPtr.h" #include "nsContentUtils.h" @@ -93,7 +94,8 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo, if (!nsChromeRegistry::gChromeRegistry) { // We don't actually want this ref, we just want the service to // initialize if it hasn't already. - nsCOMPtr reg = mozilla::services::GetChromeRegistry(); + nsCOMPtr reg = + mozilla::components::ChromeRegistry::Service(); NS_ENSURE_TRUE(nsChromeRegistry::gChromeRegistry, NS_ERROR_FAILURE); } diff --git a/dom/fetch/FetchService.cpp b/dom/fetch/FetchService.cpp index 180065668131..801213505661 100644 --- a/dom/fetch/FetchService.cpp +++ b/dom/fetch/FetchService.cpp @@ -8,6 +8,7 @@ #include "FetchParent.h" #include "mozilla/BasePrincipal.h" #include "mozilla/ClearOnShutdown.h" +#include "mozilla/Components.h" #include "mozilla/SchedulerGroup.h" #include "mozilla/UniquePtr.h" #include "mozilla/dom/ClientInfo.h" @@ -716,7 +717,7 @@ nsresult FetchService::RegisterNetworkObserver() { return NS_ERROR_UNEXPECTED; } - nsCOMPtr ioService = services::GetIOService(); + nsCOMPtr ioService = components::IO::Service(); if (!ioService) { return NS_ERROR_UNEXPECTED; } diff --git a/dom/media/mediacontrol/MediaStatusManager.cpp b/dom/media/mediacontrol/MediaStatusManager.cpp index 24579f5ee3da..ad55222105de 100644 --- a/dom/media/mediacontrol/MediaStatusManager.cpp +++ b/dom/media/mediacontrol/MediaStatusManager.cpp @@ -5,6 +5,7 @@ #include "MediaStatusManager.h" #include "MediaControlService.h" +#include "mozilla/Components.h" #include "mozilla/StaticPrefs_media.h" #include "mozilla/dom/CanonicalBrowsingContext.h" #include "mozilla/dom/Document.h" @@ -268,7 +269,8 @@ nsString MediaStatusManager::GetDefaultFaviconURL() const { // Convert URI from `chrome://XXX` to `file://XXX` because we would like to // let OS related frameworks, such as SMTC and MPRIS, handle this URL in order // to show the icon on virtual controller interface. - nsCOMPtr regService = services::GetChromeRegistry(); + nsCOMPtr regService = + components::ChromeRegistry::Service(); if (!regService) { return u""_ns; } diff --git a/js/xpconnect/loader/URLPreloader.cpp b/js/xpconnect/loader/URLPreloader.cpp index ac0af8b616a2..a919d0e5c7c7 100644 --- a/js/xpconnect/loader/URLPreloader.cpp +++ b/js/xpconnect/loader/URLPreloader.cpp @@ -5,6 +5,7 @@ #include "mozilla/URLPreloader.h" #include "mozilla/ClearOnShutdown.h" +#include "mozilla/Components.h" #include "mozilla/EndianUtils.h" #include "mozilla/FileUtils.h" #include "mozilla/IOBuffers.h" @@ -12,7 +13,6 @@ #include "mozilla/Logging.h" #include "mozilla/scache/StartupCache.h" #include "mozilla/ScopeExit.h" -#include "mozilla/Services.h" #include "mozilla/Try.h" #include "mozilla/Vector.h" @@ -132,7 +132,7 @@ Result URLPreloader::InitInternal() { mResProto = do_QueryInterface(ph, &rv); MOZ_TRY(rv); - mChromeReg = services::GetChromeRegistry(); + mChromeReg = components::ChromeRegistry::Service(); if (!mChromeReg) { return Err(NS_ERROR_UNEXPECTED); } diff --git a/startupcache/StartupCacheUtils.cpp b/startupcache/StartupCacheUtils.cpp index f6e5694ef886..138fa1370193 100644 --- a/startupcache/StartupCacheUtils.cpp +++ b/startupcache/StartupCacheUtils.cpp @@ -12,6 +12,7 @@ #include "nsStringStream.h" #include "StartupCacheUtils.h" #include "mozilla/scache/StartupCache.h" +#include "mozilla/Components.h" #include "mozilla/Omnijar.h" namespace mozilla { @@ -163,7 +164,7 @@ nsresult ResolveURI(nsIURI* in, nsIURI** out) { } if (scheme.EqualsLiteral("chrome")) { nsCOMPtr chromeReg = - mozilla::services::GetChromeRegistry(); + mozilla::components::ChromeRegistry::Service(); if (!chromeReg) return NS_ERROR_UNEXPECTED; return chromeReg->ConvertChromeURL(in, out); diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index 566509f9ef17..479066b3d9c3 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -2000,7 +2000,7 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { bool nsExternalAppHandler::IsDownloadSpam(nsIChannel* aChannel) { nsCOMPtr loadInfo = aChannel->LoadInfo(); nsCOMPtr permissionManager = - mozilla::services::GetPermissionManager(); + mozilla::components::PermissionManager::Service(); nsCOMPtr principal = loadInfo->TriggeringPrincipal(); bool exactHostMatch = false; constexpr auto type = "automatic-download"_ns; diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp index 170e6b3683b1..16314c47e068 100644 --- a/xpcom/components/ManifestParser.cpp +++ b/xpcom/components/ManifestParser.cpp @@ -27,7 +27,7 @@ # include "mozilla/BackgroundTasks.h" #endif -#include "mozilla/Services.h" +#include "mozilla/Components.h" #include "nsCRT.h" #include "nsConsoleMessage.h" #include "nsIConsoleService.h" @@ -634,7 +634,8 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf, } if (!nsChromeRegistry::gChromeRegistry) { - nsCOMPtr cr = mozilla::services::GetChromeRegistry(); + nsCOMPtr cr = + mozilla::components::ChromeRegistry::Service(); if (!nsChromeRegistry::gChromeRegistry) { LogMessageWithContext(aFile, line, "Chrome registry isn't available yet.");