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_serviceworkerparent_h__
|
|
|
|
#define mozilla_dom_serviceworkerparent_h__
|
|
|
|
|
|
|
|
#include "mozilla/dom/PServiceWorkerParent.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class IPCServiceWorkerDescriptor;
|
2018-07-10 02:02:40 +03:00
|
|
|
class ServiceWorkerProxy;
|
2018-07-10 02:02:39 +03:00
|
|
|
|
|
|
|
class ServiceWorkerParent final : public PServiceWorkerParent {
|
2018-07-10 02:02:40 +03:00
|
|
|
RefPtr<ServiceWorkerProxy> mProxy;
|
|
|
|
bool mDeleteSent;
|
|
|
|
|
2018-07-10 02:02:39 +03:00
|
|
|
// PServiceWorkerParent
|
|
|
|
void ActorDestroy(ActorDestroyReason aReason) override;
|
|
|
|
|
|
|
|
mozilla::ipc::IPCResult RecvTeardown() override;
|
|
|
|
|
2018-07-10 02:02:40 +03:00
|
|
|
mozilla::ipc::IPCResult RecvPostMessage(
|
|
|
|
const ClonedMessageData& aClonedData,
|
|
|
|
const ClientInfoAndState& aSource) override;
|
|
|
|
|
2018-07-10 02:02:39 +03:00
|
|
|
public:
|
2018-07-10 02:02:40 +03:00
|
|
|
ServiceWorkerParent();
|
|
|
|
~ServiceWorkerParent();
|
2018-07-10 02:02:39 +03:00
|
|
|
|
|
|
|
void Init(const IPCServiceWorkerDescriptor& aDescriptor);
|
2018-07-10 02:02:40 +03:00
|
|
|
|
|
|
|
void MaybeSendDelete();
|
2018-07-10 02:02:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_serviceworkerparent_h__
|