ServiceWorkerContainerChild.h (1392B)
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_serviceworkercontainerchild_h__ 8 #define mozilla_dom_serviceworkercontainerchild_h__ 9 10 #include "mozilla/dom/PServiceWorkerContainerChild.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 ServiceWorkerContainer; 18 19 class IPCWorkerRef; 20 21 class ServiceWorkerContainerChild final : public PServiceWorkerContainerChild { 22 RefPtr<IPCWorkerRef> mIPCWorkerRef; 23 ServiceWorkerContainer* mOwner; 24 bool mTeardownStarted; 25 26 ServiceWorkerContainerChild(); 27 28 ~ServiceWorkerContainerChild() = default; 29 30 // PServiceWorkerContainerChild 31 void ActorDestroy(ActorDestroyReason aReason) override; 32 33 public: 34 NS_INLINE_DECL_REFCOUNTING(ServiceWorkerContainerChild, override); 35 36 static already_AddRefed<ServiceWorkerContainerChild> Create(); 37 38 void SetOwner(ServiceWorkerContainer* aOwner); 39 40 void RevokeOwner(ServiceWorkerContainer* aOwner); 41 42 void MaybeStartTeardown(); 43 }; 44 45 } // namespace mozilla::dom 46 47 #endif // mozilla_dom_serviceworkercontainerchild_h__