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_BroadcastChannelParent_h
|
|
|
|
#define mozilla_dom_BroadcastChannelParent_h
|
|
|
|
|
|
|
|
#include "mozilla/dom/PBroadcastChannelParent.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace ipc {
|
|
|
|
class BackgroundParentImpl;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class BroadcastChannelService;
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
class BroadcastChannelParent final : public PBroadcastChannelParent
|
2015-01-15 08:58:40 -08:00
|
|
|
{
|
|
|
|
friend class mozilla::ipc::BackgroundParentImpl;
|
|
|
|
|
|
|
|
public:
|
2015-01-15 08:58:41 -08:00
|
|
|
void CheckAndDeliver(const ClonedMessageData& aData,
|
2015-01-15 08:58:40 -08:00
|
|
|
const nsString& aOrigin,
|
2015-04-01 04:41:29 -07:00
|
|
|
const nsString& aChannel,
|
|
|
|
bool aPrivateBrowsing);
|
2015-01-15 08:58:40 -08:00
|
|
|
|
|
|
|
private:
|
|
|
|
BroadcastChannelParent(const nsAString& aOrigin,
|
2015-04-01 04:41:29 -07:00
|
|
|
const nsAString& aChannel,
|
|
|
|
bool aPrivateBrowsing);
|
2015-01-15 08:58:40 -08:00
|
|
|
~BroadcastChannelParent();
|
|
|
|
|
2015-01-15 08:58:41 -08:00
|
|
|
virtual bool
|
2015-03-21 09:28:04 -07:00
|
|
|
RecvPostMessage(const ClonedMessageData& aData) override;
|
2015-01-15 08:58:40 -08:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool RecvClose() override;
|
2015-01-15 08:58:40 -08:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
2015-01-15 08:58:40 -08:00
|
|
|
|
|
|
|
nsRefPtr<BroadcastChannelService> mService;
|
|
|
|
nsString mOrigin;
|
|
|
|
nsString mChannel;
|
2015-04-01 04:41:29 -07:00
|
|
|
bool mPrivateBrowsing;
|
2015-01-15 08:58:40 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // dom namespace
|
|
|
|
} // mozilla namespace
|
|
|
|
|
|
|
|
#endif // mozilla_dom_BroadcastChannelParent_h
|