mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
Bug 1686616 - make ServiceWorkerManager use Components instead of Services. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D105527
This commit is contained in:
parent
07ad6bc655
commit
719dd81cbb
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user