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(nsTArray<MessageData>&& aMessages);
33
34
mozilla::ipc::IPCResult RecvReceiveData(nsTArray<MessageData>&& aMessages);
35
36
mozilla::ipc::IPCResult RecvStopSendingDataConfirmed();
37
38
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
39
40
// This is a raw pointer because this child is owned by this MessagePort.
41
MessagePort* mPort;
42
};
43
44
} // namespace dom
45
} // namespace mozilla
46
47
#endif // mozilla_dom_MessagePortChild_h