Bug 1892041 - Part 1: Update test262 features. r=spidermonkey-reviewers,dminor
[gecko.git] / dom / serviceworkers / ServiceWorkerRegistrationChild.h
bloba26dfd6de9a40b552e8db400c7208d0fa5cfefd3
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_serviceworkerregistrationchild_h__
8 #define mozilla_dom_serviceworkerregistrationchild_h__
10 #include "mozilla/dom/PServiceWorkerRegistrationChild.h"
12 // XXX Avoid including this here by moving function bodies to the cpp file
13 #include "mozilla/dom/WorkerRef.h"
15 namespace mozilla::dom {
17 class IPCWorkerRef;
18 class ServiceWorkerRegistration;
20 class ServiceWorkerRegistrationChild final
21 : public PServiceWorkerRegistrationChild {
22 RefPtr<IPCWorkerRef> mIPCWorkerRef;
23 ServiceWorkerRegistration* mOwner;
24 bool mTeardownStarted;
26 ServiceWorkerRegistrationChild();
28 ~ServiceWorkerRegistrationChild() = default;
30 // PServiceWorkerRegistrationChild
31 void ActorDestroy(ActorDestroyReason aReason) override;
33 mozilla::ipc::IPCResult RecvUpdateState(
34 const IPCServiceWorkerRegistrationDescriptor& aDescriptor) override;
36 mozilla::ipc::IPCResult RecvFireUpdateFound() override;
38 public:
39 NS_INLINE_DECL_REFCOUNTING(ServiceWorkerRegistrationChild, override);
41 static RefPtr<ServiceWorkerRegistrationChild> Create();
43 void SetOwner(ServiceWorkerRegistration* aOwner);
45 void RevokeOwner(ServiceWorkerRegistration* aOwner);
47 void MaybeStartTeardown();
50 } // namespace mozilla::dom
52 #endif // mozilla_dom_serviceworkerregistrationchild_h__