Bug 1459209 P11 Propogate registration state changes back from the parent to the child. r=mrbkap

--HG--
extra : rebase_source : 86bea6e7bcf6376d1fc5366a1a07b208f3805ce0
This commit is contained in:
Ben Kelly 2018-07-09 16:02:40 -07:00
parent 39b1a104c9
commit e9dc1bae32
6 changed files with 28 additions and 1 deletions

View File

@ -21,6 +21,8 @@ parent:
child:
async __delete__();
async UpdateState(IPCServiceWorkerRegistrationDescriptor aDescriptor);
};
} // namespace dom

View File

@ -161,5 +161,13 @@ RemoteServiceWorkerRegistrationImpl::RevokeActor(ServiceWorkerRegistrationChild*
}
}
void
RemoteServiceWorkerRegistrationImpl::UpdateState(const ServiceWorkerRegistrationDescriptor& aDescriptor)
{
if (mOuter) {
mOuter->UpdateState(aDescriptor);
}
}
} // namespace dom
} // namespace mozilla

View File

@ -46,6 +46,9 @@ public:
void
RevokeActor(ServiceWorkerRegistrationChild* aActor);
void
UpdateState(const ServiceWorkerRegistrationDescriptor& aDescriptor);
NS_INLINE_DECL_REFCOUNTING(RemoteServiceWorkerRegistrationImpl, override)
};

View File

@ -11,6 +11,8 @@
namespace mozilla {
namespace dom {
using mozilla::ipc::IPCResult;
void
ServiceWorkerRegistrationChild::ActorDestroy(ActorDestroyReason aReason)
{
@ -25,6 +27,15 @@ ServiceWorkerRegistrationChild::ActorDestroy(ActorDestroyReason aReason)
}
}
IPCResult
ServiceWorkerRegistrationChild::RecvUpdateState(const IPCServiceWorkerRegistrationDescriptor& aDescriptor)
{
if (mOwner) {
mOwner->UpdateState(ServiceWorkerRegistrationDescriptor(aDescriptor));
}
return IPC_OK();
}
void
ServiceWorkerRegistrationChild::WorkerShuttingDown()
{

View File

@ -26,6 +26,9 @@ class ServiceWorkerRegistrationChild final : public PServiceWorkerRegistrationCh
void
ActorDestroy(ActorDestroyReason aReason) override;
mozilla::ipc::IPCResult
RecvUpdateState(const IPCServiceWorkerRegistrationDescriptor& aDescriptor) override;
// WorkerHolderToken::Listener
void
WorkerShuttingDown() override;

View File

@ -39,7 +39,7 @@ ServiceWorkerRegistrationProxy::UpdateStateOnBGThread(const ServiceWorkerRegistr
if (!mActor) {
return;
}
// TODO: send update
Unused << mActor->SendUpdateState(aDescriptor.ToIPC());
}
void