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