Commit 9c0c03af authored by John Rummell's avatar John Rummell Committed by Commit Bot

Move CDM manifest parsing into a separate file.

Moving the code that handles the CDM manifest into a separate file
in chrome/common to support manifest parsing outside of the component
updater.

Bug: 889561,971433
Test: new unit_tests pass
Change-Id: I1d6591834f01f1fd01daf5450f5cad08f4af2e26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764249Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: John Rummell <jrummell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695246}
parent 3f4b744c
...@@ -491,8 +491,15 @@ static_library("common") { ...@@ -491,8 +491,15 @@ static_library("common") {
] ]
} }
if (enable_widevine && enable_library_cdms) { if (enable_library_cdms) {
deps += [ "//third_party/widevine/cdm:headers" ] sources += [
"media/cdm_manifest.cc",
"media/cdm_manifest.h",
]
if (enable_widevine) {
# Needed by chrome_content_client.cc.
deps += [ "//third_party/widevine/cdm:headers" ]
}
} }
if (safe_browsing_mode != 0) { if (safe_browsing_mode != 0) {
......
This diff is collapsed.
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_MEDIA_CDM_MANIFEST_H_
#define CHROME_COMMON_MEDIA_CDM_MANIFEST_H_
namespace base {
class Value;
}
namespace content {
struct CdmCapability;
}
// Returns whether the CDM's API versions, as specified in the manifest, are
// supported in this Chrome binary and not disabled at run time.
// Checks the module API, CDM interface API, and Host API.
// This should never fail except in rare cases where the component has not been
// updated recently or the user downgrades Chrome.
bool IsCdmManifestCompatibleWithChrome(const base::Value& manifest);
// Extracts the necessary information from |manifest| and updates |capability|.
// Returns true on success, false if there are errors in the manifest.
// If this method returns false, |capability| may or may not be updated.
bool ParseCdmManifest(const base::Value& manifest,
content::CdmCapability* capability);
#endif // CHROME_COMMON_MEDIA_CDM_MANIFEST_H_
This diff is collapsed.
...@@ -3333,6 +3333,10 @@ test("unit_tests") { ...@@ -3333,6 +3333,10 @@ test("unit_tests") {
} }
} }
if (enable_library_cdms) {
sources += [ "../common/media/cdm_manifest_unittest.cc" ]
}
if (!is_android) { if (!is_android) {
sources += [ sources += [
# CRLSets are not supported on Android or iOS, but available on all other # CRLSets are not supported on Android or iOS, but available on all other
......
...@@ -32,7 +32,7 @@ struct SupportedVersion { ...@@ -32,7 +32,7 @@ struct SupportedVersion {
bool enabled; bool enabled;
}; };
constexpr std::array<SupportedVersion, 3> kSupportedCdmInterfaceVersions = {{ constexpr std::array<SupportedVersion, 2> kSupportedCdmInterfaceVersions = {{
{10, true}, {10, true},
{11, false}, {11, false},
}}; }};
......
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