Bug 1891340 - Part 1: Add parameters to customize the before and after icon tints...
[gecko.git] / ipc / glue / UtilityAudioDecoder.cpp
blob0a294d95f5a039979abda452a13952de1482fab9
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) {
15 switch (aSandbox) {
16 case GENERIC_UTILITY:
17 return UtilityActorName::AudioDecoder_Generic;
18 #ifdef MOZ_APPLEMEDIA
19 case UTILITY_AUDIO_DECODING_APPLE_MEDIA:
20 return UtilityActorName::AudioDecoder_AppleMedia;
21 #endif
22 #ifdef XP_WIN
23 case UTILITY_AUDIO_DECODING_WMF:
24 return UtilityActorName::AudioDecoder_WMF;
25 #endif
26 #ifdef MOZ_WMF_MEDIA_ENGINE
27 case MF_MEDIA_ENGINE_CDM:
28 return UtilityActorName::MfMediaEngineCDM;
29 #endif
30 default:
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