ServiceWorkerContainerProxy.h (1561B)
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 moz_dom_ServiceWorkerContainerProxy_h 8 #define moz_dom_ServiceWorkerContainerProxy_h 9 10 #include "mozilla/RefPtr.h" 11 #include "mozilla/dom/ServiceWorkerUtils.h" 12 13 namespace mozilla::dom { 14 15 class ServiceWorkerContainerParent; 16 17 class ServiceWorkerContainerProxy final { 18 // Background thread only 19 RefPtr<ServiceWorkerContainerParent> mActor; 20 21 ~ServiceWorkerContainerProxy(); 22 23 public: 24 explicit ServiceWorkerContainerProxy(ServiceWorkerContainerParent* aActor); 25 26 void RevokeActor(ServiceWorkerContainerParent* aActor); 27 28 RefPtr<ServiceWorkerRegistrationPromise> Register( 29 const ClientInfo& aClientInfo, const nsACString& aScopeURL, 30 const WorkerType& aType, const nsACString& aScriptURL, 31 ServiceWorkerUpdateViaCache aUpdateViaCache); 32 33 RefPtr<ServiceWorkerRegistrationPromise> GetRegistration( 34 const ClientInfo& aClientInfo, const nsACString& aURL); 35 36 RefPtr<ServiceWorkerRegistrationListPromise> GetRegistrations( 37 const ClientInfo& aClientInfo); 38 39 RefPtr<ServiceWorkerRegistrationPromise> GetReady( 40 const ClientInfo& aClientInfo); 41 42 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ServiceWorkerContainerProxy); 43 }; 44 45 } // namespace mozilla::dom 46 47 #endif // moz_dom_ServiceWorkerContainerProxy_h