Bug 1439099 P2 Remove ServiceWorkerRegistrationInfo::GetByID(). r=asuth

This commit is contained in:
Ben Kelly 2018-02-19 12:06:19 -08:00
parent ced996a4df
commit e67b89fe1c
3 changed files with 3 additions and 25 deletions

View File

@ -569,10 +569,9 @@ ClientSource::PostMessage(const ClientPostMessageArgs& aArgs)
RefPtr<ServiceWorkerRegistrationInfo> reg =
swm->GetRegistration(principal, source.Scope());
if (reg) {
RefPtr<ServiceWorkerInfo> serviceWorker = reg->GetByID(source.Id());
if (serviceWorker) {
RefPtr<ServiceWorker> instance =
globalObject->GetOrCreateServiceWorker(source);
RefPtr<ServiceWorker> instance =
globalObject->GetOrCreateServiceWorker(source);
if (instance) {
init.mSource.SetValue().SetAsServiceWorker() = instance;
}
}

View File

@ -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
{

View File

@ -151,9 +151,6 @@ public:
ServiceWorkerInfo*
GetActive() const;
ServiceWorkerInfo*
GetByID(uint64_t aID) const;
ServiceWorkerInfo*
GetByDescriptor(const ServiceWorkerDescriptor& aDescriptor) const;