Add widevine third party

Add 2 new command options to use widevine:
- widevine-cdm-path: Path to widevine plugin
- widevine-cdm-version: Version of the widevine plugin
This commit is contained in:
Cyrille Lebeaupin 2015-12-16 11:06:38 +01:00 committed by Cheng Zhao
parent 5f3c6107d5
commit 9d878ad6b2
17 changed files with 529 additions and 12 deletions

View file

@ -15,6 +15,7 @@
#include "base/version.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/widevine_cdm_constants.h"
#if defined(OS_ANDROID)
#include "base/android/path_utils.h"
@ -31,6 +32,8 @@
#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.
@ -362,7 +365,7 @@ bool PathProvider(int key, base::FilePath* result) {
case chrome::DIR_COMPONENT_WIDEVINE_CDM:
if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
return false;
cur = cur.Append(FILE_PATH_LITERAL("WidevineCDM"));
cur = cur.Append(kWidevineCdmBaseDirectory);
break;
#endif // defined(WIDEVINE_CDM_IS_COMPONENT)
// TODO(xhwang): FILE_WIDEVINE_CDM_ADAPTER has different meanings.

View file

@ -0,0 +1,16 @@
// Copyright (c) 2013 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.
#include "chrome/common/widevine_cdm_constants.h"
#include "build/build_config.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
const base::FilePath::CharType kWidevineCdmBaseDirectory[] =
FILE_PATH_LITERAL("WidevineCDM");
const char kWidevineCdmPluginExtension[] = "";
const int32 kWidevineCdmPluginPermissions = ppapi::PERMISSION_DEV |
ppapi::PERMISSION_PRIVATE;

View file

@ -0,0 +1,19 @@
// Copyright (c) 2013 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_WIDEVINE_CDM_CONSTANTS_H_
#define CHROME_COMMON_WIDEVINE_CDM_CONSTANTS_H_
#include "base/basictypes.h"
#include "base/files/file_path.h"
// The Widevine CDM adapter and Widevine CDM are in this directory.
extern const base::FilePath::CharType kWidevineCdmBaseDirectory[];
extern const char kWidevineCdmPluginExtension[];
// Permission bits for Widevine CDM plugin.
extern const int32 kWidevineCdmPluginPermissions;
#endif // CHROME_COMMON_WIDEVINE_CDM_CONSTANTS_H_

View file

@ -0,0 +1,31 @@
// Copyright (c) 2013 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.
// Multiply-included message file, hence no include guard.
#include <vector>
#include "ipc/ipc_message_macros.h"
// #include "ipc/ipc_param_traits.h"
#define IPC_MESSAGE_START ChromeMsgStart
// Renderer -> Browser messages.
#if defined(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).
// When the returned *|is_available| is true, |additional_param_names| and
// |additional_param_values| contain the name-value pairs, if any, specified
// for the *first* non-disabled plugin found that is registered for |mime_type|.
IPC_SYNC_MESSAGE_CONTROL1_3(
ChromeViewHostMsg_IsInternalPluginAvailableForMimeType,
std::string /* mime_type */,
bool /* is_available */,
std::vector<base::string16> /* additional_param_names */,
std::vector<base::string16> /* additional_param_values */)
#endif
// Browser -> Renderer messages.