Lines 111-116
Link Here
|
111 |
content::PepperPluginInfo::PPP_ShutdownModuleFunc g_nacl_shutdown_module; |
111 |
content::PepperPluginInfo::PPP_ShutdownModuleFunc g_nacl_shutdown_module; |
112 |
#endif |
112 |
#endif |
113 |
|
113 |
|
|
|
114 |
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \ |
115 |
!defined(WIDEVINE_CDM_IS_COMPONENT) |
116 |
const size_t kMaxWidevineCdmVersionFileLength = 32; |
117 |
|
118 |
std::string ComputeWidevineVersionString() { |
119 |
base::FilePath path; |
120 |
|
121 |
if (PathService::Get(chrome::FILE_WIDEVINE_CDM_VERSION, &path)) { |
122 |
std::string version; |
123 |
|
124 |
ReadFileToString(path, &version, kMaxWidevineCdmVersionFileLength); |
125 |
if (!version.empty()) { |
126 |
size_t newline = version.find_first_of("\r\n"); |
127 |
if (newline != std::string::npos) |
128 |
version.erase(newline); |
129 |
|
130 |
return version; |
131 |
} |
132 |
} |
133 |
|
134 |
return "<unknown version>"; |
135 |
} |
136 |
#endif |
137 |
|
114 |
// Appends the known built-in plugins to the given vector. Some built-in |
138 |
// Appends the known built-in plugins to the given vector. Some built-in |
115 |
// plugins are "internal" which means they are compiled into the Chrome binary, |
139 |
// plugins are "internal" which means they are compiled into the Chrome binary, |
116 |
// and some are extra shared libraries distributed with the browser (these are |
140 |
// and some are extra shared libraries distributed with the browser (these are |
Lines 169-182
Link Here
|
169 |
static bool skip_widevine_cdm_file_check = false; |
193 |
static bool skip_widevine_cdm_file_check = false; |
170 |
if (PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &path)) { |
194 |
if (PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &path)) { |
171 |
if (skip_widevine_cdm_file_check || base::PathExists(path)) { |
195 |
if (skip_widevine_cdm_file_check || base::PathExists(path)) { |
|
|
196 |
std::string widevine_cdm_version_string = ComputeWidevineVersionString(); |
172 |
content::PepperPluginInfo widevine_cdm; |
197 |
content::PepperPluginInfo widevine_cdm; |
173 |
widevine_cdm.is_out_of_process = true; |
198 |
widevine_cdm.is_out_of_process = true; |
174 |
widevine_cdm.path = path; |
199 |
widevine_cdm.path = path; |
175 |
widevine_cdm.name = kWidevineCdmDisplayName; |
200 |
widevine_cdm.name = kWidevineCdmDisplayName; |
176 |
widevine_cdm.description = kWidevineCdmDescription + |
201 |
widevine_cdm.description = kWidevineCdmDescription + |
177 |
std::string(" (version: ") + |
202 |
std::string(" (version: ") + |
178 |
WIDEVINE_CDM_VERSION_STRING + ")"; |
203 |
widevine_cdm_version_string + ")"; |
179 |
widevine_cdm.version = WIDEVINE_CDM_VERSION_STRING; |
204 |
widevine_cdm.version = widevine_cdm_version_string; |
180 |
content::WebPluginMimeType widevine_cdm_mime_type( |
205 |
content::WebPluginMimeType widevine_cdm_mime_type( |
181 |
kWidevineCdmPluginMimeType, |
206 |
kWidevineCdmPluginMimeType, |
182 |
kWidevineCdmPluginExtension, |
207 |
kWidevineCdmPluginExtension, |