Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/media/gmp/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  ChromiumCDMAdapter.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 ChromiumAdapter_h_
#define ChromiumAdapter_h_

#include <utility>

#include "GMPLoader.h"
#include "GMPUtils.h"
#include "content_decryption_module_ext.h"
#include "nsString.h"
#include "nsTArray.h"
#include "prlink.h"

struct GMPPlatformAPI;

namespace mozilla {

#if defined(XP_WIN)
typedef nsString HostFileString;
#else
typedef nsCString HostFileString;
#endif

class HostFile {
 public:
  explicit HostFile(const nsCString& aPath);
  HostFile(HostFile&& aOther);
  ~HostFile();

  const HostFileString& Path() const { return mPath; }
  cdm::PlatformFile TakePlatformFile();

 private:
  const HostFileString mPath;
  cdm::PlatformFile mFile = cdm::kInvalidPlatformFile;
};

struct HostFileData {
  HostFileData(HostFile&& aBinary, HostFile&& aSig)
      : mBinary(std::move(aBinary)), mSig(std::move(aSig)) {}

  HostFileData(HostFileData&& aOther)
      : mBinary(std::move(aOther.mBinary)), mSig(std::move(aOther.mSig)) {}

  ~HostFileData() = default;

  HostFile mBinary;
  HostFile mSig;
};

class ChromiumCDMAdapter : public gmp::GMPAdapter {
 public:
  explicit ChromiumCDMAdapter(
      nsTArray<std::pair<nsCString, nsCString>>&& aHostPathPairs);

  void SetAdaptee(PRLibrary* aLib) override;

  // These are called in place of the corresponding GMP API functions.
  GMPErr GMPInit(const GMPPlatformAPI* aPlatformAPI) override;
  GMPErr GMPGetAPI(const char* aAPIName, void* aHostAPI, void** aPluginAPI,
                   const nsACString& aKeySystem) override;
  void GMPShutdown() override;

  static bool Supports(int32_t aModuleVersion, int32_t aInterfaceVersion,
                       int32_t aHostVersion);

 private:
  void PopulateHostFiles(
      nsTArray<std::pair<nsCString, nsCString>>&& aHostFilePaths);

  PRLibrary* mLib = nullptr;
  nsTArray<HostFileData> mHostFiles;
};

}  // namespace mozilla

#endif  // ChromiumAdapter_h_

Messung V0.5 in Prozent
C=80 H=99 G=90

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© 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.