chromium/chrome/browser/media/cdm_document_service_impl.h

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_MEDIA_CDM_DOCUMENT_SERVICE_IMPL_H_
#define CHROME_BROWSER_MEDIA_CDM_DOCUMENT_SERVICE_IMPL_H_

#include <set>
#include <string>

#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/document_service.h"
#include "media/mojo/mojom/cdm_document_service.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/attestation/platform_verification_flow.h"
#endif

#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chromeos/crosapi/mojom/content_protection.mojom.h"
#endif  // BUILDFLAG(IS_CHROMEOS_LACROS)

// Implements media::mojom::CdmDocumentService. Can only be used on the
// UI thread because PlatformVerificationFlow and the pref service lives on the
// UI thread.
// Ownership Note: There's one CdmDocumentServiceImpl per RenderFrame per
// service type ( MediaFoundationService or CdmService). For
// MediaFoundationService's case, this can be seen in the ownership chain of
// InterfaceFactoryImpl -> MediaFoundationCdmFactory -> MojoCdmHelper
// -> mojo::Remote<mojom::CdmDocumentService>.
class CdmDocumentServiceImpl final
    : public content::DocumentService<media::mojom::CdmDocumentService> {};

#endif  // CHROME_BROWSER_MEDIA_CDM_DOCUMENT_SERVICE_IMPL_H_