Bug 1686616 - make ServiceWorkerManager use Components instead of Services. r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D105527
This commit is contained in:
Alexis Beingessner 2021-02-18 13:26:31 +00:00
parent 07ad6bc655
commit 719dd81cbb
4 changed files with 9 additions and 9 deletions

View File

@ -4562,7 +4562,7 @@ mozilla::ipc::IPCResult ContentParent::RecvOpenNotificationSettings(
mozilla::ipc::IPCResult ContentParent::RecvNotificationEvent(
const nsString& aType, const NotificationEventData& aData) {
nsCOMPtr<nsIServiceWorkerManager> swm =
mozilla::services::GetServiceWorkerManager();
mozilla::components::ServiceWorkerManager::Service();
if (NS_WARN_IF(!swm)) {
// Probably shouldn't happen, but no need to crash the child process.
return IPC_OK();

View File

@ -16,7 +16,7 @@
#include "mozilla/JSONWriter.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/Components.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Unused.h"
@ -1194,7 +1194,7 @@ ServiceWorkerNotificationObserver::Observe(nsISupports* aSubject,
if (!strcmp("alertclickcallback", aTopic)) {
if (XRE_IsParentProcess() || !ServiceWorkerParentInterceptEnabled()) {
nsCOMPtr<nsIServiceWorkerManager> swm =
mozilla::services::GetServiceWorkerManager();
mozilla::components::ServiceWorkerManager::Service();
if (NS_WARN_IF(!swm)) {
return NS_ERROR_FAILURE;
}
@ -1229,7 +1229,7 @@ ServiceWorkerNotificationObserver::Observe(nsISupports* aSubject,
if (XRE_IsParentProcess() || !ServiceWorkerParentInterceptEnabled()) {
nsCOMPtr<nsIServiceWorkerManager> swm =
mozilla::services::GetServiceWorkerManager();
mozilla::components::ServiceWorkerManager::Service();
if (NS_WARN_IF(!swm)) {
return NS_ERROR_FAILURE;
}

View File

@ -15,7 +15,7 @@
#include "nsThreadUtils.h"
#include "nsNetUtil.h"
#include "nsPIDOMWindow.h"
#include "mozilla/Services.h"
#include "mozilla/Components.h"
#include "mozilla/StaticPrefs_dom.h"
#include "nsCycleCollectionParticipant.h"
@ -605,7 +605,7 @@ void ServiceWorkerContainer::GetScopeForUrl(const nsAString& aUrl,
nsString& aScope,
ErrorResult& aRv) {
nsCOMPtr<nsIServiceWorkerManager> swm =
mozilla::services::GetServiceWorkerManager();
mozilla::components::ServiceWorkerManager::Service();
if (!swm) {
aRv.Throw(NS_ERROR_FAILURE);
return;

View File

@ -18,7 +18,7 @@
#include "mozilla/dom/WorkerRef.h"
#include "mozilla/dom/WorkerRunnable.h"
#include "mozilla/dom/WorkerScope.h"
#include "mozilla/Services.h"
#include "mozilla/Components.h"
#include "mozilla/Unused.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIPrincipal.h"
@ -459,7 +459,7 @@ class StartUnregisterRunnable final : public Runnable {
nsCOMPtr<nsIPrincipal> principal = principalOrErr.unwrap();
nsCOMPtr<nsIServiceWorkerManager> swm =
mozilla::services::GetServiceWorkerManager();
mozilla::components::ServiceWorkerManager::Service();
if (!swm) {
mPromise->Reject(NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
return NS_OK;
@ -545,7 +545,7 @@ void ServiceWorkerRegistrationMainThread::Unregister(
}
nsCOMPtr<nsIServiceWorkerManager> swm =
mozilla::services::GetServiceWorkerManager();
mozilla::components::ServiceWorkerManager::Service();
if (!swm) {
aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
return;