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_serviceworkercontainerparent_h__ 8 #define mozilla_dom_serviceworkercontainerparent_h__ 9 10 #include "mozilla/dom/PServiceWorkerContainerParent.h" 11 12 namespace mozilla { 13 namespace dom { 14 15 class IPCServiceWorkerDescriptor; 16 class ServiceWorkerContainerProxy; 17 18 class ServiceWorkerContainerParent final 19 : public PServiceWorkerContainerParent { 20 RefPtr<ServiceWorkerContainerProxy> mProxy; 21 22 ~ServiceWorkerContainerParent(); 23 24 // PServiceWorkerContainerParent 25 void ActorDestroy(ActorDestroyReason aReason) override; 26 27 mozilla::ipc::IPCResult RecvTeardown() override; 28 29 mozilla::ipc::IPCResult RecvRegister( 30 const IPCClientInfo& aClientInfo, const nsCString& aScopeURL, 31 const nsCString& aScriptURL, 32 const ServiceWorkerUpdateViaCache& aUpdateViaCache, 33 RegisterResolver&& aResolver) override; 34 35 mozilla::ipc::IPCResult RecvGetRegistration( 36 const IPCClientInfo& aClientInfo, const nsCString& aURL, 37 GetRegistrationResolver&& aResolver) override; 38 39 mozilla::ipc::IPCResult RecvGetRegistrations( 40 const IPCClientInfo& aClientInfo, 41 GetRegistrationsResolver&& aResolver) override; 42 43 mozilla::ipc::IPCResult RecvGetReady(const IPCClientInfo& aClientInfo, 44 GetReadyResolver&& aResolver) override; 45 46 public: 47 NS_INLINE_DECL_REFCOUNTING(ServiceWorkerContainerParent, override); 48 49 ServiceWorkerContainerParent(); 50 51 void Init(); 52 }; 53 54 } // namespace dom 55 } // namespace mozilla 56 57 #endif // mozilla_dom_serviceworkercontainerparent_h__ 58