2015-05-03 22:32:37 +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: */
|
2015-01-15 19:58:40 +03:00
|
|
|
/* 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_BroadcastChannelChild_h
|
|
|
|
#define mozilla_dom_BroadcastChannelChild_h
|
|
|
|
|
|
|
|
#include "mozilla/dom/PBroadcastChannelChild.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace ipc {
|
|
|
|
class BackgroundChildImpl;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace ipc
|
2015-01-15 19:58:40 +03:00
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
|
2015-01-15 19:58:41 +03:00
|
|
|
class BroadcastChannel;
|
2015-01-15 19:58:40 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class BroadcastChannelChild final : public PBroadcastChannelChild
|
2015-01-15 19:58:40 +03:00
|
|
|
{
|
|
|
|
friend class mozilla::ipc::BackgroundChildImpl;
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_INLINE_DECL_REFCOUNTING(BroadcastChannelChild)
|
|
|
|
|
2015-01-15 19:58:41 +03:00
|
|
|
void SetParent(BroadcastChannel* aBC)
|
2015-01-15 19:58:40 +03:00
|
|
|
{
|
2015-01-15 19:58:41 +03:00
|
|
|
mBC = aBC;
|
2015-01-15 19:58:40 +03:00
|
|
|
}
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvNotify(const ClonedMessageData& aData) override;
|
2015-01-15 19:58:40 +03:00
|
|
|
|
|
|
|
bool IsActorDestroyed() const
|
|
|
|
{
|
|
|
|
return mActorDestroyed;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2015-07-06 21:28:41 +03:00
|
|
|
explicit BroadcastChannelChild(const nsACString& aOrigin);
|
2015-01-15 19:58:40 +03:00
|
|
|
~BroadcastChannelChild();
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
2015-01-15 19:58:40 +03:00
|
|
|
|
|
|
|
// This raw pointer is actually the parent object.
|
|
|
|
// It's set to null when the parent object is deleted.
|
2015-01-15 19:58:41 +03:00
|
|
|
BroadcastChannel* mBC;
|
2015-01-15 19:58:40 +03:00
|
|
|
|
|
|
|
nsString mOrigin;
|
|
|
|
|
|
|
|
bool mActorDestroyed;
|
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2015-01-15 19:58:40 +03:00
|
|
|
|
|
|
|
#endif // mozilla_dom_BroadcastChannelChild_h
|