Commit 8d677754 authored by John Rummell's avatar John Rummell Committed by Commit Bot

Add cdm_storage_id_key to GN args to allow other implementations to override

Generating the Storage ID requires a browser specific value. Update the GN
files so that other embedders can provide the value through GN args.

Also updates the build files to reference the internal file used by Chrome
to provide the value when building official versions.

BUG=478960
TEST=compiles with changed GN args

Change-Id: Id14e32fb38c60e4d4112ab71500a98b79e3a6035
Reviewed-on: https://chromium-review.googlesource.com/812567
Commit-Queue: John Rummell <jrummell@chromium.org>
Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525239}
parent 685f0325
......@@ -3628,6 +3628,9 @@ split_static_library("browser") {
"media/cdm_storage_id_key.cc",
"media/cdm_storage_id_key.h",
]
if (is_chrome_branded) {
sources += [ "internal/google_chrome_cdm_storage_id_key.h" ]
}
}
deps += [ "//media/mojo/interfaces" ]
if (mojo_media_host == "browser") {
......
......@@ -6,7 +6,11 @@
#include "media/media_features.h"
#if BUILDFLAG(ENABLE_CDM_STORAGE_ID) && defined(GOOGLE_CHROME_BUILD)
#if !BUILDFLAG(ENABLE_CDM_STORAGE_ID)
#error This should only be compiled if "enable_cdm_storage_id" specified.
#endif
#if defined(GOOGLE_CHROME_BUILD)
#include "chrome/browser/internal/google_chrome_cdm_storage_id_key.h"
#endif
......@@ -14,6 +18,9 @@ std::string GetCdmStorageIdKey() {
#if defined(CDM_STORAGE_ID_KEY)
return CDM_STORAGE_ID_KEY;
#else
#error CDM_STORAGE_ID_KEY must be defined if enable_cdm_storage_id specified.
// For non-Google-Chrome builds, the GN flag "alternate_cdm_storage_id_key"
// must be set if "enable_cdm_storage_id" specified. See comments in
// media/media_options.gni.
return BUILDFLAG(ALTERNATE_CDM_STORAGE_ID_KEY);
#endif
}
......@@ -17,6 +17,7 @@ buildflag_header("media_features") {
header = "media_features.h"
flags = [
"ALTERNATE_CDM_STORAGE_ID_KEY=$alternate_cdm_storage_id_key",
"ENABLE_AC3_EAC3_AUDIO_DEMUXING=$enable_ac3_eac3_audio_demuxing",
"ENABLE_CBCS_ENCRYPTION_SCHEME=$enable_cbcs_encryption_scheme",
"ENABLE_CDM_HOST_VERIFICATION=$enable_cdm_host_verification",
......
......@@ -166,6 +166,12 @@ declare_args() {
# branding, but may be overridden by other embedders.
enable_cdm_storage_id = enable_library_cdms && is_chrome_branded &&
(is_win || is_mac || is_chromeos)
# If |enable_cdm_storage_id| is set, then an implementation specific key
# must also be provided. It can be provided by defining CDM_STORAGE_ID_KEY
# (which takes precedence), or by setting |alternate_cdm_storage_id_key|.
# The key must be a string of at least 32 characters.
alternate_cdm_storage_id_key = ""
}
# This feature can only be enabled when using Mojo media. Furthermore, the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment