This commit is contained in:
Cheng Zhao 2015-12-29 16:41:44 +08:00
Родитель 8ca1bea58b
Коммит c76db0ba1d
6 изменённых файлов: 13 добавлений и 31 удалений

Просмотреть файл

@ -19,13 +19,10 @@
#include "content/public/common/pepper_plugin_info.h"
#include "content/public/common/user_agent.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
#include "url/url_constants.h"
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
// The following must be after widevine_cdm_version.h.
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
// && !defined(WIDEVINE_CDM_IS_COMPONENT)
#include "chrome/common/widevine_cdm_constants.h"
#endif
@ -73,10 +70,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
return plugin;
}
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
//&& !defined(WIDEVINE_CDM_IS_COMPONENT)
content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
const std::string& version) {
content::PepperPluginInfo widevine_cdm;
@ -113,11 +107,7 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
return widevine_cdm;
}
#endif
// defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) &&
// !defined(WIDEVINE_CDM_IS_COMPONENT)
void ConvertStringWithSeparatorToVector(std::vector<std::string>* vec,
const char* separator,
@ -148,12 +138,11 @@ void AddPepperFlashFromCommandLine(
}
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
//&& !defined(WIDEVINE_CDM_IS_COMPONENT)
void AddWidevineCdmFromCommandLine(
std::vector<content::PepperPluginInfo>* plugins) {
auto command_line = base::CommandLine::ForCurrentProcess();
auto widevine_cdm_path = command_line->GetSwitchValueNative(
switches::kWidevineCdmPath);
switches::kWidevineCdmPath);
if (widevine_cdm_path.empty())
return;
@ -161,19 +150,14 @@ void AddWidevineCdmFromCommandLine(
return;
auto widevine_cdm_version = command_line->GetSwitchValueASCII(
switches::kWidevineCdmVersion);
switches::kWidevineCdmVersion);
if (widevine_cdm_version.empty())
return;
plugins->push_back(
CreateWidevineCdmInfo(base::FilePath(widevine_cdm_path),
widevine_cdm_version));
plugins->push_back(CreateWidevineCdmInfo(base::FilePath(widevine_cdm_path),
widevine_cdm_version));
}
#endif
// defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) &&
// !defined(WIDEVINE_CDM_IS_COMPONENT)
AtomContentClient::AtomContentClient() {
}
@ -207,11 +191,9 @@ void AtomContentClient::AddAdditionalSchemes(
void AtomContentClient::AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) {
AddPepperFlashFromCommandLine(plugins);
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
//&& !defined(WIDEVINE_CDM_IS_COMPONENT)
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
AddWidevineCdmFromCommandLine(plugins);
#endif
#endif
}
void AtomContentClient::AddServiceWorkerSchemes(

Просмотреть файл

@ -107,7 +107,7 @@ void AtomBrowserClient::RenderProcessWillLaunch(
host->AddFilter(new printing::PrintingMessageFilter(process_id));
host->AddFilter(new TtsMessageFilter(process_id, host->GetBrowserContext()));
host->AddFilter(
new WidevineCdmMessageFilter(process_id, host->GetBrowserContext()));
new WidevineCdmMessageFilter(process_id, host->GetBrowserContext()));
}
content::SpeechRecognitionManagerDelegate*

Просмотреть файл

@ -237,7 +237,7 @@ void AtomRendererClient::EnableWebRuntimeFeatures() {
}
void AtomRendererClient::AddKeySystems(
std::vector<media::KeySystemInfo>* key_systems) {
std::vector<media::KeySystemInfo>* key_systems) {
AddChromeKeySystems(key_systems);
}

Просмотреть файл

@ -60,6 +60,7 @@ class AtomRendererClient : public content::ContentRendererClient,
const content::RenderFrame* render_frame,
blink::WebPageVisibilityState* override_state) override;
void AddKeySystems(std::vector<media::KeySystemInfo>* key_systems) override;
void EnableWebRuntimeFeatures();
scoped_ptr<NodeBindings> node_bindings_;

Просмотреть файл

@ -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"
using content::PluginService;
using content::WebPluginInfo;
using content::BrowserThread;
@ -39,7 +40,6 @@ void WidevineCdmMessageFilter::OnIsInternalPluginAvailableForMimeType(
bool* is_available,
std::vector<base::string16>* additional_param_names,
std::vector<base::string16>* additional_param_values) {
std::vector<WebPluginInfo> plugins;
PluginService::GetInstance()->GetInternalPlugins(&plugins);
@ -67,4 +67,4 @@ void WidevineCdmMessageFilter::OnDestruct() const {
}
WidevineCdmMessageFilter::~WidevineCdmMessageFilter() {
}
}

Просмотреть файл

@ -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 "third_party/widevine/cdm/stub/widevine_cdm_version.h"
#if defined(OS_ANDROID)
#include "base/android/path_utils.h"
@ -32,8 +33,6 @@
#include "base/win/registry.h"
#endif
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
namespace {
// The Pepper Flash plugins are in a directory with this name.