media: Replace ENABLE_PEPPER_CDMS buildflag with ENABLE_LIBRARY_CDMS
https://chromium-review.googlesource.com/582309
This commit is contained in:
parent
e59f788c43
commit
8c0c1e4ded
6 changed files with 27 additions and 22 deletions
|
@ -19,13 +19,14 @@
|
|||
#include "content/public/common/content_constants.h"
|
||||
#include "content/public/common/pepper_plugin_info.h"
|
||||
#include "content/public/common/user_agent.h"
|
||||
#include "media/media_features.h"
|
||||
#include "pdf/pdf.h"
|
||||
#include "ppapi/shared_impl/ppapi_permissions.h"
|
||||
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "url/url_constants.h"
|
||||
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
#include "chrome/common/widevine_cdm_constants.h"
|
||||
#endif
|
||||
|
||||
|
@ -73,7 +74,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
|
|||
return plugin;
|
||||
}
|
||||
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
|
||||
const std::string& version) {
|
||||
content::PepperPluginInfo widevine_cdm;
|
||||
|
@ -108,7 +109,7 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
|
|||
|
||||
return widevine_cdm;
|
||||
}
|
||||
#endif
|
||||
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
|
||||
void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
|
||||
content::PepperPluginInfo pdf_info;
|
||||
|
@ -156,7 +157,7 @@ void AddPepperFlashFromCommandLine(
|
|||
plugins->push_back(CreatePepperFlashInfo(flash_path, flash_version));
|
||||
}
|
||||
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
void AddWidevineCdmFromCommandLine(
|
||||
std::vector<content::PepperPluginInfo>* plugins) {
|
||||
auto command_line = base::CommandLine::ForCurrentProcess();
|
||||
|
@ -176,7 +177,7 @@ void AddWidevineCdmFromCommandLine(
|
|||
plugins->push_back(CreateWidevineCdmInfo(widevine_cdm_path,
|
||||
widevine_cdm_version));
|
||||
}
|
||||
#endif
|
||||
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
|
||||
AtomContentClient::AtomContentClient() {
|
||||
}
|
||||
|
@ -216,9 +217,9 @@ void AtomContentClient::AddAdditionalSchemes(Schemes* schemes) {
|
|||
void AtomContentClient::AddPepperPlugins(
|
||||
std::vector<content::PepperPluginInfo>* plugins) {
|
||||
AddPepperFlashFromCommandLine(plugins);
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
AddWidevineCdmFromCommandLine(plugins);
|
||||
#endif
|
||||
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
ComputeBuiltInPlugins(plugins);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/common/webplugininfo.h"
|
||||
#include "content/public/browser/plugin_service.h"
|
||||
#include "media/media_features.h"
|
||||
|
||||
using content::PluginService;
|
||||
using content::WebPluginInfo;
|
||||
|
@ -24,17 +25,17 @@ WidevineCdmMessageFilter::WidevineCdmMessageFilter(
|
|||
|
||||
bool WidevineCdmMessageFilter::OnMessageReceived(const IPC::Message& message) {
|
||||
IPC_BEGIN_MESSAGE_MAP(WidevineCdmMessageFilter, message)
|
||||
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
IPC_MESSAGE_HANDLER(
|
||||
ChromeViewHostMsg_IsInternalPluginAvailableForMimeType,
|
||||
OnIsInternalPluginAvailableForMimeType)
|
||||
#endif
|
||||
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
IPC_MESSAGE_UNHANDLED(return false)
|
||||
IPC_END_MESSAGE_MAP()
|
||||
return true;
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
void WidevineCdmMessageFilter::OnIsInternalPluginAvailableForMimeType(
|
||||
const std::string& mime_type,
|
||||
bool* is_available,
|
||||
|
@ -60,7 +61,7 @@ void WidevineCdmMessageFilter::OnIsInternalPluginAvailableForMimeType(
|
|||
|
||||
*is_available = false;
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
|
||||
void WidevineCdmMessageFilter::OnDestruct() const {
|
||||
BrowserThread::DeleteOnUIThread::Destruct(this);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "chrome/common/widevine_cdm_messages.h"
|
||||
#include "content/public/browser/browser_message_filter.h"
|
||||
#include "media/media_features.h"
|
||||
|
||||
namespace content {
|
||||
class BrowserContext;
|
||||
|
@ -25,7 +26,7 @@ class WidevineCdmMessageFilter : public content::BrowserMessageFilter {
|
|||
|
||||
virtual ~WidevineCdmMessageFilter();
|
||||
|
||||
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
// Returns whether any internal plugin supporting |mime_type| is registered
|
||||
// and enabled. Does not determine whether the plugin can actually be
|
||||
// instantiated (e.g. whether it has all its dependencies).
|
||||
|
@ -38,7 +39,7 @@ class WidevineCdmMessageFilter : public content::BrowserMessageFilter {
|
|||
bool* is_available,
|
||||
std::vector<base::string16>* additional_param_names,
|
||||
std::vector<base::string16>* additional_param_values);
|
||||
#endif
|
||||
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
|
||||
int render_process_id_;
|
||||
content::BrowserContext* browser_context_;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "chrome/common/chrome_constants.h"
|
||||
#include "chrome/common/chrome_paths_internal.h"
|
||||
#include "chrome/common/widevine_cdm_constants.h"
|
||||
#include "media/media_features.h"
|
||||
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
|
||||
#include "third_party/widevine/cdm/widevine_cdm_common.h"
|
||||
|
||||
|
@ -360,7 +361,7 @@ bool PathProvider(int key, base::FilePath* result) {
|
|||
#endif
|
||||
cur = cur.Append(FILE_PATH_LITERAL("pnacl"));
|
||||
break;
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
#if defined(WIDEVINE_CDM_IS_COMPONENT)
|
||||
case chrome::DIR_COMPONENT_WIDEVINE_CDM:
|
||||
if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
|
||||
|
@ -376,7 +377,7 @@ bool PathProvider(int key, base::FilePath* result) {
|
|||
return false;
|
||||
cur = cur.AppendASCII(kWidevineCdmAdapterFileName);
|
||||
break;
|
||||
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
case chrome::FILE_RESOURCES_PACK:
|
||||
#if defined(OS_MACOSX) && !defined(OS_IOS)
|
||||
if (base::mac::AmIBundled()) {
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
#include <vector>
|
||||
|
||||
#include "ipc/ipc_message_macros.h"
|
||||
#include "ppapi/features/features.h"
|
||||
#include "media/media_features.h"
|
||||
|
||||
#define IPC_MESSAGE_START ChromeMsgStart
|
||||
|
||||
// Renderer -> Browser messages.
|
||||
|
||||
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
// Returns whether any internal plugin supporting |mime_type| is registered and
|
||||
// enabled. Does not determine whether the plugin can actually be instantiated
|
||||
// (e.g. whether it has all its dependencies).
|
||||
|
@ -26,6 +26,6 @@ IPC_SYNC_MESSAGE_CONTROL1_3(
|
|||
bool /* is_available */,
|
||||
std::vector<base::string16> /* additional_param_names */,
|
||||
std::vector<base::string16> /* additional_param_values */)
|
||||
#endif
|
||||
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
|
||||
// Browser -> Renderer messages.
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "content/public/renderer/render_thread.h"
|
||||
#include "media/base/eme_constants.h"
|
||||
#include "media/base/key_system_properties.h"
|
||||
#include "media/media_features.h"
|
||||
|
||||
// #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
|
||||
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
|
||||
|
@ -32,7 +33,7 @@
|
|||
using media::KeySystemProperties;
|
||||
using media::SupportedCodecs;
|
||||
|
||||
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
static const char kExternalClearKeyPepperType[] =
|
||||
"application/x-ppapi-clearkey-cdm";
|
||||
|
||||
|
@ -264,15 +265,15 @@ static void AddPepperBasedWidevine(
|
|||
#endif // defined(OS_CHROMEOS)
|
||||
}
|
||||
#endif // defined(WIDEVINE_CDM_AVAILABLE)
|
||||
#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
|
||||
void AddChromeKeySystems(
|
||||
std::vector<std::unique_ptr<KeySystemProperties>>* key_systems_properties) {
|
||||
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
AddExternalClearKey(key_systems_properties);
|
||||
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE)
|
||||
AddPepperBasedWidevine(key_systems_properties);
|
||||
#endif // defined(WIDEVINE_CDM_AVAILABLE)
|
||||
#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
|
||||
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue