2018-07-10 02:02:39 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_serviceworkerregistrationchild_h__
|
|
|
|
#define mozilla_dom_serviceworkerregistrationchild_h__
|
|
|
|
|
|
|
|
#include "mozilla/dom/PServiceWorkerRegistrationChild.h"
|
2018-07-10 02:02:39 +03:00
|
|
|
#include "mozilla/dom/WorkerHolderToken.h"
|
2018-07-10 02:02:39 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2018-07-10 02:02:39 +03:00
|
|
|
class RemoteServiceWorkerRegistrationImpl;
|
|
|
|
|
2018-07-10 02:02:39 +03:00
|
|
|
class ServiceWorkerRegistrationChild final : public PServiceWorkerRegistrationChild
|
2018-07-10 02:02:39 +03:00
|
|
|
, public WorkerHolderToken::Listener
|
2018-07-10 02:02:39 +03:00
|
|
|
{
|
2018-07-10 02:02:39 +03:00
|
|
|
RefPtr<WorkerHolderToken> mWorkerHolderToken;
|
|
|
|
RemoteServiceWorkerRegistrationImpl* mOwner;
|
|
|
|
bool mTeardownStarted;
|
|
|
|
|
2018-07-10 02:02:39 +03:00
|
|
|
// PServiceWorkerRegistrationChild
|
|
|
|
void
|
|
|
|
ActorDestroy(ActorDestroyReason aReason) override;
|
|
|
|
|
2018-07-10 02:02:40 +03:00
|
|
|
mozilla::ipc::IPCResult
|
|
|
|
RecvUpdateState(const IPCServiceWorkerRegistrationDescriptor& aDescriptor) override;
|
|
|
|
|
2018-07-10 02:02:39 +03:00
|
|
|
// WorkerHolderToken::Listener
|
|
|
|
void
|
|
|
|
WorkerShuttingDown() override;
|
|
|
|
|
2018-07-10 02:02:39 +03:00
|
|
|
public:
|
2018-07-10 02:02:39 +03:00
|
|
|
explicit ServiceWorkerRegistrationChild(WorkerHolderToken* aWorkerHolderToken);
|
2018-07-10 02:02:39 +03:00
|
|
|
~ServiceWorkerRegistrationChild() = default;
|
2018-07-10 02:02:39 +03:00
|
|
|
|
|
|
|
void
|
|
|
|
SetOwner(RemoteServiceWorkerRegistrationImpl* aOwner);
|
|
|
|
|
|
|
|
void
|
|
|
|
RevokeOwner(RemoteServiceWorkerRegistrationImpl* aOwner);
|
|
|
|
|
|
|
|
void
|
|
|
|
MaybeStartTeardown();
|
2018-07-10 02:02:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_serviceworkerregistrationchild_h__
|