Source code

Revision control

Other Tools

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_MessagePortChild_h
8
#define mozilla_dom_MessagePortChild_h
9
10
#include "mozilla/Assertions.h"
11
#include "mozilla/dom/PMessagePortChild.h"
12
#include "nsISupportsImpl.h"
13
14
namespace mozilla {
15
namespace dom {
16
17
class MessagePort;
18
19
class MessagePortChild final : public PMessagePortChild {
20
friend class PMessagePortChild;
21
22
public:
23
NS_INLINE_DECL_REFCOUNTING(MessagePortChild)
24
25
MessagePortChild();
26
27
void SetPort(MessagePort* aPort) { mPort = aPort; }
28
29
private:
30
~MessagePortChild() { MOZ_ASSERT(!mPort); }
31
32
mozilla::ipc::IPCResult RecvEntangled(
33
nsTArray<ClonedMessageData>&& aMessages);
34
35
mozilla::ipc::IPCResult RecvReceiveData(
36
nsTArray<ClonedMessageData>&& aMessages);
37
38
mozilla::ipc::IPCResult RecvStopSendingDataConfirmed();
39
40
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
41
42
// This is a raw pointer because this child is owned by this MessagePort.
43
MessagePort* mPort;
44
};
45
46
} // namespace dom
47
} // namespace mozilla
48
49
#endif // mozilla_dom_MessagePortChild_h