1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 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/. */
7 #include "mozilla/ProcInfo.h"
8 #include "mozilla/ipc/UtilityAudioDecoder.h"
9 #include "mozilla/dom/BindingUtils.h"
10 #include "mozilla/ipc/UtilityProcessChild.h"
12 namespace mozilla::ipc
{
14 UtilityActorName
GetAudioActorName(const SandboxingKind aSandbox
) {
17 return UtilityActorName::AudioDecoder_Generic
;
19 case UTILITY_AUDIO_DECODING_APPLE_MEDIA
:
20 return UtilityActorName::AudioDecoder_AppleMedia
;
23 case UTILITY_AUDIO_DECODING_WMF
:
24 return UtilityActorName::AudioDecoder_WMF
;
26 #ifdef MOZ_WMF_MEDIA_ENGINE
27 case MF_MEDIA_ENGINE_CDM
:
28 return UtilityActorName::MfMediaEngineCDM
;
31 MOZ_CRASH("Unexpected mSandbox for GetActorName()");
35 nsCString
GetChildAudioActorName() {
36 RefPtr
<ipc::UtilityProcessChild
> s
= ipc::UtilityProcessChild::Get();
37 MOZ_ASSERT(s
, "Has UtilityProcessChild");
38 return dom::GetEnumString(GetAudioActorName(s
->mSandbox
));
41 } // namespace mozilla::ipc