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