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