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_serviceworkercontainerchild_h__
|
|
|
|
#define mozilla_dom_serviceworkercontainerchild_h__
|
|
|
|
|
|
|
|
#include "mozilla/dom/PServiceWorkerContainerChild.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 {
|
|
|
|
|
|
|
|
class ServiceWorkerContainerChild final : public PServiceWorkerContainerChild,
|
2018-07-10 02:02:39 +03:00
|
|
|
public WorkerHolderToken::Listener {
|
|
|
|
RefPtr<WorkerHolderToken> mWorkerHolderToken;
|
|
|
|
RemoteServiceWorkerContainerImpl* mOwner;
|
|
|
|
bool mTeardownStarted;
|
|
|
|
|
2018-07-10 02:02:39 +03:00
|
|
|
// PServiceWorkerContainerChild
|
|
|
|
void ActorDestroy(ActorDestroyReason aReason) 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 ServiceWorkerContainerChild(WorkerHolderToken* aWorkerHolderToken);
|
2018-07-10 02:02:39 +03:00
|
|
|
~ServiceWorkerContainerChild() = default;
|
2018-07-10 02:02:39 +03:00
|
|
|
|
|
|
|
void SetOwner(RemoteServiceWorkerContainerImpl* aOwner);
|
|
|
|
|
|
|
|
void RevokeOwner(RemoteServiceWorkerContainerImpl* aOwner);
|
|
|
|
|
|
|
|
void MaybeStartTeardown();
|
2018-07-10 02:02:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_serviceworkercontainerchild_h__
|