1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5  * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 #ifndef mozilla_dom_BroadcastChannelParent_h
8 #define mozilla_dom_BroadcastChannelParent_h
9 
10 #include "mozilla/dom/PBroadcastChannelParent.h"
11 
12 namespace mozilla {
13 
14 namespace ipc {
15 class BackgroundParentImpl;
16 class PrincipalInfo;
17 }  // namespace ipc
18 
19 namespace dom {
20 
21 class BroadcastChannelService;
22 
23 class BroadcastChannelParent final : public PBroadcastChannelParent {
24   friend class mozilla::ipc::BackgroundParentImpl;
25 
26   typedef mozilla::ipc::PrincipalInfo PrincipalInfo;
27 
28  private:
29   explicit BroadcastChannelParent(const nsAString& aOriginChannelKey);
30   ~BroadcastChannelParent();
31 
32   virtual mozilla::ipc::IPCResult RecvPostMessage(
33       const MessageData& aData) override;
34 
35   virtual mozilla::ipc::IPCResult RecvClose() override;
36 
37   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
38 
39   RefPtr<BroadcastChannelService> mService;
40   const nsString mOriginChannelKey;
41 };
42 
43 }  // namespace dom
44 }  // namespace mozilla
45 
46 #endif  // mozilla_dom_BroadcastChannelParent_h
47