Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  EMEOriginID.h

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */


#ifndef DOM_MEDIA_EME_EMEORIGINID_H_
#define DOM_MEDIA_EME_EMEORIGINID_H_

#include "mozilla/StaticPrefs_media.h"
#include "mozilla/media/MediaChild.h"
#include "nsIPrincipal.h"

namespace mozilla {

// Returns a per-origin ID using the shared OriginKeyStore infrastructure.
// The returned promise resolves to an ID string or an empty string if origin
// ID is disabled or unavailable. The underlying GetPrincipalKey call
// may also reject the promise; callers should proceed without an Origin ID in
// either case. Private browsing principals automatically receive temporary
// IDs that are cleared when the PB session ends.
inline RefPtr<media::PrincipalKeyPromise> GetEMEOriginID(
    nsIPrincipal* aPrincipal) {
  MOZ_ASSERT(NS_IsMainThread());

  if (!StaticPrefs::media_eme_mediadrm_origin_id_enabled() || !aPrincipal) {
    return media::PrincipalKeyPromise::CreateAndResolve(""_ns, __func__);
  }

  ipc::PrincipalInfo principalInfo;
  nsresult rv = ipc::PrincipalToPrincipalInfo(aPrincipal, &principalInfo);
  if (NS_FAILED(rv)) {
    return media::PrincipalKeyPromise::CreateAndResolve(""_ns, __func__);
  }

  // The OriginKeyStore infrastructure already routes private browsing
  // principals to a separate in-memory-only table, so the persist flag is
  // irrelevant for private browsing.
  return media::GetPrincipalKey(principalInfo, /*aPersist*/ true);
}

}  // namespace mozilla

#endif  // DOM_MEDIA_EME_EMEORIGINID_H_

Messung V0.5 in Prozent
C=98 H=97 G=97

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=752002