ServiceWorkerRegistrationChild.h (1609B)
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/. */ 6 7 #ifndef mozilla_dom_serviceworkerregistrationchild_h__ 8 #define mozilla_dom_serviceworkerregistrationchild_h__ 9 10 #include "mozilla/dom/PServiceWorkerRegistrationChild.h" 11 12 // XXX Avoid including this here by moving function bodies to the cpp file 13 #include "mozilla/dom/WorkerRef.h" 14 15 namespace mozilla::dom { 16 17 class IPCWorkerRef; 18 class ServiceWorkerRegistration; 19 20 class ServiceWorkerRegistrationChild final 21 : public PServiceWorkerRegistrationChild { 22 RefPtr<IPCWorkerRef> mIPCWorkerRef; 23 ServiceWorkerRegistration* mOwner; 24 25 ServiceWorkerRegistrationChild(); 26 27 ~ServiceWorkerRegistrationChild() = default; 28 29 // PServiceWorkerRegistrationChild 30 void ActorDestroy(ActorDestroyReason aReason) override; 31 32 mozilla::ipc::IPCResult RecvUpdateState( 33 const IPCServiceWorkerRegistrationDescriptor& aDescriptor) override; 34 35 mozilla::ipc::IPCResult RecvFireUpdateFound() override; 36 37 public: 38 NS_INLINE_DECL_REFCOUNTING(ServiceWorkerRegistrationChild, override); 39 40 static RefPtr<ServiceWorkerRegistrationChild> Create(); 41 42 void SetOwner(ServiceWorkerRegistration* aOwner); 43 44 void RevokeOwner(ServiceWorkerRegistration* aOwner); 45 46 // Idempotently delete the actor. 47 void Shutdown(); 48 }; 49 50 } // namespace mozilla::dom 51 52 #endif // mozilla_dom_serviceworkerregistrationchild_h__