Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  MediaDrmProvisioningHelper.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 http://mozilla.org/MPL/2.0/. */


#ifndef DOM_MEDIA_EME_MEDIADRM_MEDIADRMPROVISIONINGHELPER_H_
#define DOM_MEDIA_EME_MEDIADRM_MEDIADRMPROVISIONINGHELPER_H_

#include "mozilla/PRemoteCDMChild.h"
#include "mozilla/dom/PromiseNativeHandler.h"
#include "nsISerialEventTarget.h"

namespace mozilla {

/**
 * MediaDrm may require us to provision during EME playback, which consists of
 * sending a POST request to the given URL with a given sequence of request
 * bytes, granted by AMediaDrm_getProvisionRequest. When we receive the
 * response, we need to call AMediaDrm_provideProvisionResponse. This class runs
 * in the content process to perform this network request on behalf of the
 * decrypting process.
 */

class MediaDrmProvisioningHelper final : public dom::PromiseNativeHandler {
 public:
  NS_DECL_THREADSAFE_ISUPPORTS

  explicit MediaDrmProvisioningHelper(
      const RemoteCDMProvisionRequestIPDL& aRequest,
      PRemoteCDMChild::ProvisionResolver&& aResolver);

  void Provision();

  MOZ_CAN_RUN_SCRIPT
  void ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue,
                        ErrorResult& aRv) override;

  MOZ_CAN_RUN_SCRIPT
  void RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue,
                        ErrorResult& aRv) override;

 private:
  ~MediaDrmProvisioningHelper() override;

  template <class T>
  void MaybeResolve(T&& aResult) {
    if (!mResolver) {
      return;
    }

    (void)mEventTarget->Dispatch(NS_NewRunnableFunction(
        __func__, [result = std::move(aResult),
                   resolver = std::move(mResolver)]() { resolver(result); }));
    mResolver = nullptr;
  }

  const nsCOMPtr<nsISerialEventTarget> mEventTarget;
  nsString mServerUrl;
  nsString mRequestData;
  PRemoteCDMChild::ProvisionResolver mResolver;
};

}  // namespace mozilla

#endif  // DOM_MEDIA_EME_MEDIADRM_MEDIADRMPROVISIONINGHELPER_H_

Messung V0.5 in Prozent
C=94 H=100 G=96

¤ Dauer der Verarbeitung: 0.7 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