Backed out 8 changesets (bug 1873776) for causing vendor failures. CLOSED TREE
[gecko.git] / ipc / glue / UtilityAudioDecoder.cpp
blob0b28fd601e5fdbdc9a5c26471b6d7fb0affee5dc
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/ipc/UtilityProcessChild.h"
11 namespace mozilla::ipc {
13 UtilityActorName GetAudioActorName(const SandboxingKind aSandbox) {
14 switch (aSandbox) {
15 case GENERIC_UTILITY:
16 return UtilityActorName::AudioDecoder_Generic;
17 #ifdef MOZ_APPLEMEDIA
18 case UTILITY_AUDIO_DECODING_APPLE_MEDIA:
19 return UtilityActorName::AudioDecoder_AppleMedia;
20 #endif
21 #ifdef XP_WIN
22 case UTILITY_AUDIO_DECODING_WMF:
23 return UtilityActorName::AudioDecoder_WMF;
24 #endif
25 #ifdef MOZ_WMF_MEDIA_ENGINE
26 case MF_MEDIA_ENGINE_CDM:
27 return UtilityActorName::MfMediaEngineCDM;
28 #endif
29 default:
30 MOZ_CRASH("Unexpected mSandbox for GetActorName()");
34 nsCString GetChildAudioActorName() {
35 RefPtr<ipc::UtilityProcessChild> s = ipc::UtilityProcessChild::Get();
36 MOZ_ASSERT(s, "Has UtilityProcessChild");
37 return nsCString(dom::WebIDLUtilityActorNameValues::GetString(
38 GetAudioActorName(s->mSandbox)));
41 } // namespace mozilla::ipc