tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

UtilityMediaService.cpp (1357B)


      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/. */
      6 
      7 #include "mozilla/ProcInfo.h"
      8 #include "mozilla/ipc/UtilityMediaService.h"
      9 #include "mozilla/dom/BindingUtils.h"
     10 #include "mozilla/ipc/UtilityProcessChild.h"
     11 
     12 namespace mozilla::ipc {
     13 
     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()");
     32  }
     33 }
     34 
     35 nsCString GetChildAudioActorName() {
     36  RefPtr<ipc::UtilityProcessChild> s = ipc::UtilityProcessChild::Get();
     37  MOZ_ASSERT(s, "Has UtilityProcessChild");
     38  return dom::GetEnumString(GetAudioActorName(s->mSandbox));
     39 }
     40 
     41 }  // namespace mozilla::ipc