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(ServiceWorkerRegistrationCallback&& aSuccessCB,
33
ServiceWorkerFailureCallback&& aFailureCB) override;
34
35
void Unregister(ServiceWorkerBoolCallback&& aSuccessCB,
36
ServiceWorkerFailureCallback&& aFailureCB) override;
37
38
public:
39
explicit RemoteServiceWorkerRegistrationImpl(
40
const ServiceWorkerRegistrationDescriptor& aDescriptor);
41
42
void RevokeActor(ServiceWorkerRegistrationChild* aActor);
43
44
void UpdateState(const ServiceWorkerRegistrationDescriptor& aDescriptor);
45
46
void FireUpdateFound();
47
48
NS_INLINE_DECL_REFCOUNTING(RemoteServiceWorkerRegistrationImpl, override)
49
};
50
51
} // namespace dom
52
} // namespace mozilla
53
54
#endif // mozilla_dom_remoteserviceworkerregistrationimpl_h__