Commit 1925b1af authored by Allan Sandfeld Jensen's avatar Allan Sandfeld Jensen
Browse files

Fix pepper cdms feature


Is now also buildflag and not command line define.

Change-Id: I3c687981928239f669bd285797b5ceee4e994822
Reviewed-by: default avatarMichal Klocek <michal.klocek@qt.io>
Showing with 14 additions and 12 deletions
......@@ -58,7 +58,7 @@ BrowserMessageFilterQt::BrowserMessageFilterQt(int /*render_process_id*/)
bool BrowserMessageFilterQt::OnMessageReceived(const IPC::Message& message)
{
IPC_BEGIN_MESSAGE_MAP(BrowserMessageFilterQt, message)
#if defined(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
IPC_MESSAGE_HANDLER(
QtWebEngineHostMsg_IsInternalPluginAvailableForMimeType,
OnIsInternalPluginAvailableForMimeType)
......@@ -68,7 +68,7 @@ bool BrowserMessageFilterQt::OnMessageReceived(const IPC::Message& message)
return true;
}
#if defined(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
void BrowserMessageFilterQt::OnIsInternalPluginAvailableForMimeType(
const std::string& mime_type, bool* is_available,
std::vector<base::string16>* additional_param_names,
......@@ -93,6 +93,6 @@ void BrowserMessageFilterQt::OnIsInternalPluginAvailableForMimeType(
*is_available = false;
}
#endif // defined(ENABLE_PEPPER_CDMS)
#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
} // namespace QtWebEngineCore
......@@ -41,6 +41,7 @@
#define BROWSER_MESSAGE_FILTER_QT_H
#include "content/public/browser/browser_message_filter.h"
#include "ppapi/features/features.h"
#include <QtGlobal>
......@@ -53,7 +54,7 @@ public:
private:
bool OnMessageReceived(const IPC::Message& message) Q_DECL_OVERRIDE;
#if defined(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_PEPPER_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).
......
......@@ -6,6 +6,7 @@
#include "content/public/common/common_param_traits.h"
#include "ipc/ipc_message_macros.h"
#include "ppapi/features/features.h"
#include "user_script_data.h"
......@@ -72,7 +73,7 @@ IPC_MESSAGE_ROUTED1(WebChannelIPCTransportHost_SendMessage, std::vector<char> /*
// Misc messages
// These are messages sent from the renderer to the browser process.
#if defined(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_PEPPER_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).
......
......@@ -412,7 +412,7 @@ void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost*
const int id = host->GetID();
content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(id, url::kFileScheme);
static_cast<BrowserContextQt*>(host->GetBrowserContext())->m_adapter->userResourceController()->renderProcessStartedWithHost(host);
#if defined(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
host->AddFilter(new BrowserMessageFilterQt(id));
#endif
#if BUILDFLAG(ENABLE_SPELLCHECK)
......
......@@ -193,7 +193,7 @@ void AddPepperFlashFromCommandLine(std::vector<content::PepperPluginInfo>* plugi
void AddPepperWidevine(std::vector<content::PepperPluginInfo>* plugins)
{
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && !defined(WIDEVINE_CDM_IS_COMPONENT)
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) && !defined(WIDEVINE_CDM_IS_COMPONENT)
QStringList pluginPaths;
const base::CommandLine::StringType widevine_argument = base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(switches::kPpapiWidevinePath);
if (!widevine_argument.empty())
......@@ -263,7 +263,7 @@ void AddPepperWidevine(std::vector<content::PepperPluginInfo>* plugins)
plugins->push_back(widevine_cdm);
}
}
#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) &&
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) &&
// !defined(WIDEVINE_CDM_IS_COMPONENT)
}
......
......@@ -222,7 +222,7 @@ bool ContentRendererClientQt::IsLinkVisited(unsigned long long linkHash)
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#if defined(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
static const char kExternalClearKeyPepperType[] = "application/x-ppapi-clearkey-cdm";
static bool IsPepperCdmAvailable(const std::string& pepper_type,
......@@ -400,17 +400,17 @@ static void AddPepperBasedWidevine(std::vector<std::unique_ptr<media::KeySystemP
media::EmeFeatureSupport::NOT_SUPPORTED)); // Distinctive identifier.
}
#endif // defined(WIDEVINE_CDM_AVAILABLE)
#endif // defined(ENABLE_PEPPER_CDMS)
#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
void ContentRendererClientQt::AddSupportedKeySystems(std::vector<std::unique_ptr<media::KeySystemProperties>> *key_systems)
{
#if defined(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
AddExternalClearKey(key_systems);
#if defined(WIDEVINE_CDM_AVAILABLE)
AddPepperBasedWidevine(key_systems);
#endif // defined(WIDEVINE_CDM_AVAILABLE)
#endif // defined(ENABLE_PEPPER_CDMS)
#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
}
} // namespace
Supports Markdown
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