MediaSystemResourceManagerChild.cpp 1.2 KB

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