Source code

Revision control

Other Tools

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_remoteserviceworkerregistrationimpl_h__
8
#define mozilla_dom_remoteserviceworkerregistrationimpl_h__
9
10
#include "ServiceWorkerRegistration.h"
11
12
namespace mozilla {
13
namespace dom {
14
15
class ServiceWorkerRegistrationChild;
16
17
class RemoteServiceWorkerRegistrationImpl final
18
: public ServiceWorkerRegistration::Inner {
19
ServiceWorkerRegistrationChild* mActor;
20
ServiceWorkerRegistration* mOuter;
21
bool mShutdown;
22
23
~RemoteServiceWorkerRegistrationImpl();
24
25
void Shutdown();
26
27
// ServiceWorkerRegistration::Inner implementation
28
void SetServiceWorkerRegistration(ServiceWorkerRegistration* aReg) override;
29
30
void ClearServiceWorkerRegistration(ServiceWorkerRegistration* aReg) override;
31
32
void Update(const nsCString& aNewestWorkerScriptUrl,
33
ServiceWorkerRegistrationCallback&& aSuccessCB,
34
ServiceWorkerFailureCallback&& aFailureCB) override;
35
36
void Unregister(ServiceWorkerBoolCallback&& aSuccessCB,
37
ServiceWorkerFailureCallback&& aFailureCB) override;
38
39
public:
40
explicit RemoteServiceWorkerRegistrationImpl(
41
const ServiceWorkerRegistrationDescriptor& aDescriptor);
42
43
void RevokeActor(ServiceWorkerRegistrationChild* aActor);
44
45
void UpdateState(const ServiceWorkerRegistrationDescriptor& aDescriptor);
46
47
void FireUpdateFound();
48
49
NS_INLINE_DECL_REFCOUNTING(RemoteServiceWorkerRegistrationImpl, override)
50
};
51
52
} // namespace dom
53
} // namespace mozilla
54
55
#endif // mozilla_dom_remoteserviceworkerregistrationimpl_h__