Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 :
6 : #include "MessagePortChild.h"
7 : #include "MessagePort.h"
8 : #include "mozilla/dom/MessageEvent.h"
9 : #include "mozilla/ipc/PBackgroundChild.h"
10 :
11 : namespace mozilla {
12 : namespace dom {
13 :
14 : mozilla::ipc::IPCResult
15 0 : MessagePortChild::RecvStopSendingDataConfirmed()
16 : {
17 0 : MOZ_ASSERT(mPort);
18 0 : mPort->StopSendingDataConfirmed();
19 0 : MOZ_ASSERT(!mPort);
20 0 : return IPC_OK();
21 : }
22 :
23 : mozilla::ipc::IPCResult
24 0 : MessagePortChild::RecvEntangled(nsTArray<ClonedMessageData>&& aMessages)
25 : {
26 0 : if (mPort) {
27 0 : mPort->Entangled(aMessages);
28 : }
29 0 : return IPC_OK();
30 : }
31 :
32 : mozilla::ipc::IPCResult
33 0 : MessagePortChild::RecvReceiveData(nsTArray<ClonedMessageData>&& aMessages)
34 : {
35 0 : if (mPort) {
36 0 : mPort->MessagesReceived(aMessages);
37 : }
38 0 : return IPC_OK();
39 : }
40 :
41 : void
42 0 : MessagePortChild::ActorDestroy(ActorDestroyReason aWhy)
43 : {
44 0 : if (mPort) {
45 0 : mPort->Closed();
46 0 : MOZ_ASSERT(!mPort);
47 : }
48 0 : }
49 :
50 : } // namespace dom
51 : } // namespace mozilla
|