Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2709)

Unified Diff: chrome/common/chrome_content_client.cc

Issue 2582463003: media: Verify CDM Host files (Closed)
Patch Set: comments addressed Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/chrome_content_client.h ('k') | chrome/common/media/cdm_host_file_path.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_content_client.cc
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index 4255c1b6664da68748e9ba36aba82aa990b25221..29a51e77264933eb9fdc20775c513aeedf7b86b7 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -85,6 +85,10 @@
#include "chrome/common/widevine_cdm_constants.h"
#endif
+#if BUILDFLAG(ENABLE_PEPPER_CDMS)
+#include "chrome/common/media/cdm_host_file_path.h"
+#endif
+
#if defined(OS_ANDROID)
#include "chrome/common/chrome_media_client_android.h"
#endif
@@ -534,26 +538,35 @@ void ChromeContentClient::AddPepperPlugins(
}
void ChromeContentClient::AddContentDecryptionModules(
- std::vector<content::CdmInfo>* cdms) {
+ std::vector<content::CdmInfo>* cdms,
+ std::vector<content::CdmHostFilePath>* cdm_host_file_paths) {
+ if (cdms) {
// TODO(jrummell): Need to have a better flag to indicate systems Widevine
// is available on. For now we continue to use ENABLE_PEPPER_CDMS so that
// we can experiment between pepper and mojo.
#if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT)
- base::FilePath adapter_path;
- base::FilePath cdm_path;
- std::vector<std::string> codecs_supported;
- if (IsWidevineAvailable(&adapter_path, &cdm_path, &codecs_supported)) {
- // CdmInfo needs |path| to be the actual Widevine library,
- // not the adapter, so adjust as necessary. It will be in the
- // same directory as the installed adapter.
- const base::Version version(WIDEVINE_CDM_VERSION_STRING);
- DCHECK(version.IsValid());
- cdms->push_back(content::CdmInfo(kWidevineCdmType, version, cdm_path,
- codecs_supported));
- }
+ base::FilePath adapter_path;
+ base::FilePath cdm_path;
+ std::vector<std::string> codecs_supported;
+ if (IsWidevineAvailable(&adapter_path, &cdm_path, &codecs_supported)) {
+ // CdmInfo needs |path| to be the actual Widevine library,
+ // not the adapter, so adjust as necessary. It will be in the
+ // same directory as the installed adapter.
+ const base::Version version(WIDEVINE_CDM_VERSION_STRING);
+ DCHECK(version.IsValid());
+ cdms->push_back(content::CdmInfo(kWidevineCdmType, version, cdm_path,
+ codecs_supported));
+ }
#endif // defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT)
- // TODO(jrummell): Add External Clear Key CDM for testing, if it's available.
+ // TODO(jrummell): Add External Clear Key CDM for testing, if it's
+ // available.
+ }
+
+#if BUILDFLAG(ENABLE_PEPPER_CDMS)
+ if (cdm_host_file_paths)
+ chrome::AddCdmHostFilePaths(cdm_host_file_paths);
+#endif
}
static const char* const kChromeStandardURLSchemes[] = {
« no previous file with comments | « chrome/common/chrome_content_client.h ('k') | chrome/common/media/cdm_host_file_path.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698