Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/messagechannel/MessagePortChild.cpp
Line
Count
Source (jump to first uncovered line)
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
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#include "MessagePortChild.h"
8
#include "MessagePort.h"
9
#include "mozilla/dom/MessageEvent.h"
10
#include "mozilla/ipc/PBackgroundChild.h"
11
12
namespace mozilla {
13
namespace dom {
14
15
MessagePortChild::MessagePortChild()
16
  : mPort(nullptr)
17
0
{
18
0
}
19
20
mozilla::ipc::IPCResult
21
MessagePortChild::RecvStopSendingDataConfirmed()
22
0
{
23
0
  MOZ_ASSERT(mPort);
24
0
  mPort->StopSendingDataConfirmed();
25
0
  MOZ_ASSERT(!mPort);
26
0
  return IPC_OK();
27
0
}
28
29
mozilla::ipc::IPCResult
30
MessagePortChild::RecvEntangled(nsTArray<ClonedMessageData>&& aMessages)
31
0
{
32
0
  if (mPort) {
33
0
    mPort->Entangled(aMessages);
34
0
  }
35
0
  return IPC_OK();
36
0
}
37
38
mozilla::ipc::IPCResult
39
MessagePortChild::RecvReceiveData(nsTArray<ClonedMessageData>&& aMessages)
40
0
{
41
0
  if (mPort) {
42
0
    mPort->MessagesReceived(aMessages);
43
0
  }
44
0
  return IPC_OK();
45
0
}
46
47
void
48
MessagePortChild::ActorDestroy(ActorDestroyReason aWhy)
49
0
{
50
0
  if (mPort) {
51
0
    mPort->Closed();
52
0
    MOZ_ASSERT(!mPort);
53
0
  }
54
0
}
55
56
} // namespace dom
57
} // namespace mozilla