Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/media/systemservices/MediaSystemResourceManagerChild.cpp
Line
Count
Source (jump to first uncovered line)
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 "MediaSystemResourceManager.h"
7
8
#include "MediaSystemResourceManagerChild.h"
9
10
namespace mozilla {
11
namespace media {
12
13
MediaSystemResourceManagerChild::MediaSystemResourceManagerChild()
14
  : mDestroyed(false)
15
  , mManager(nullptr)
16
0
{
17
0
}
18
19
MediaSystemResourceManagerChild::~MediaSystemResourceManagerChild()
20
0
{
21
0
}
22
23
mozilla::ipc::IPCResult
24
MediaSystemResourceManagerChild::RecvResponse(const uint32_t& aId,
25
                                              const bool& aSuccess)
26
0
{
27
0
  if (mManager) {
28
0
    mManager->RecvResponse(aId, aSuccess);
29
0
  }
30
0
  return IPC_OK();
31
0
}
32
33
void
34
MediaSystemResourceManagerChild::ActorDestroy(ActorDestroyReason aActorDestroyReason)
35
0
{
36
0
  MOZ_ASSERT(!mDestroyed);
37
0
  if (mManager) {
38
0
    mManager->OnIpcClosed();
39
0
  }
40
0
  mDestroyed = true;
41
0
}
42
43
void
44
MediaSystemResourceManagerChild::Destroy()
45
0
{
46
0
  if (mDestroyed) {
47
0
    return;
48
0
  }
49
0
  SendRemoveResourceManager();
50
0
  // WARNING: |this| is dead, hands off
51
0
}
52
53
} // namespace media
54
} // namespace mozilla