From e67b89fe1c0f85dbaf0a9927cb204cb0d84249d8 Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Mon, 19 Feb 2018 12:06:19 -0800 Subject: [PATCH] Bug 1439099 P2 Remove ServiceWorkerRegistrationInfo::GetByID(). r=asuth --- dom/clients/manager/ClientSource.cpp | 7 +++---- .../ServiceWorkerRegistrationInfo.cpp | 18 ------------------ .../ServiceWorkerRegistrationInfo.h | 3 --- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/dom/clients/manager/ClientSource.cpp b/dom/clients/manager/ClientSource.cpp index 1a52a991db38..ba4b0230a638 100644 --- a/dom/clients/manager/ClientSource.cpp +++ b/dom/clients/manager/ClientSource.cpp @@ -569,10 +569,9 @@ ClientSource::PostMessage(const ClientPostMessageArgs& aArgs) RefPtr reg = swm->GetRegistration(principal, source.Scope()); if (reg) { - RefPtr serviceWorker = reg->GetByID(source.Id()); - if (serviceWorker) { - RefPtr instance = - globalObject->GetOrCreateServiceWorker(source); + RefPtr instance = + globalObject->GetOrCreateServiceWorker(source); + if (instance) { init.mSource.SetValue().SetAsServiceWorker() = instance; } } diff --git a/dom/serviceworkers/ServiceWorkerRegistrationInfo.cpp b/dom/serviceworkers/ServiceWorkerRegistrationInfo.cpp index ac627e35f499..4be02dc67467 100644 --- a/dom/serviceworkers/ServiceWorkerRegistrationInfo.cpp +++ b/dom/serviceworkers/ServiceWorkerRegistrationInfo.cpp @@ -491,24 +491,6 @@ ServiceWorkerRegistrationInfo::GetActive() const return mActiveWorker; } -ServiceWorkerInfo* -ServiceWorkerRegistrationInfo::GetByID(uint64_t aID) const -{ - if (mActiveWorker && mActiveWorker->ID() == aID) { - return mActiveWorker; - } - if (mWaitingWorker && mWaitingWorker->ID() == aID) { - return mWaitingWorker; - } - if (mInstallingWorker && mInstallingWorker->ID() == aID) { - return mInstallingWorker; - } - if (mEvaluatingWorker && mEvaluatingWorker->ID() == aID) { - return mEvaluatingWorker; - } - return nullptr; -} - ServiceWorkerInfo* ServiceWorkerRegistrationInfo::GetByDescriptor(const ServiceWorkerDescriptor& aDescriptor) const { diff --git a/dom/serviceworkers/ServiceWorkerRegistrationInfo.h b/dom/serviceworkers/ServiceWorkerRegistrationInfo.h index e54284029aea..dd7c4fda278b 100644 --- a/dom/serviceworkers/ServiceWorkerRegistrationInfo.h +++ b/dom/serviceworkers/ServiceWorkerRegistrationInfo.h @@ -151,9 +151,6 @@ public: ServiceWorkerInfo* GetActive() const; - ServiceWorkerInfo* - GetByID(uint64_t aID) const; - ServiceWorkerInfo* GetByDescriptor(const ServiceWorkerDescriptor& aDescriptor) const;