From a33720558e655dc49afd4e976add99f97c0cb6dc Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 24 Sep 2015 11:34:51 +0300 Subject: [PATCH] Don't create Widevine-related folders when Widevine support is disabled (issue #1713) --- libcef/common/main_delegate.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/libcef/common/main_delegate.cc b/libcef/common/main_delegate.cc index 7a9e372d0..98c8c9746 100644 --- a/libcef/common/main_delegate.cc +++ b/libcef/common/main_delegate.cc @@ -535,16 +535,19 @@ void CefMainDelegate::PreSandboxStartup() { true); // Create if necessary. #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) - const base::FilePath& widevine_plugin_path = GetResourcesFilePath(); - PathService::Override(chrome::FILE_WIDEVINE_CDM_ADAPTER, - widevine_plugin_path.AppendASCII( - kWidevineCdmAdapterFileName)); + const base::FilePath& widevine_plugin_path = + GetResourcesFilePath().AppendASCII(kWidevineCdmAdapterFileName); + if (base::PathExists(widevine_plugin_path)) { + PathService::Override(chrome::FILE_WIDEVINE_CDM_ADAPTER, + widevine_plugin_path); + } #if defined(WIDEVINE_CDM_IS_COMPONENT) - PathService::Override(chrome::DIR_COMPONENT_WIDEVINE_CDM, - user_data_path.Append(kWidevineCdmBaseDirectory)); + if (command_line->HasSwitch(switches::kEnableWidevineCdm)) { + PathService::Override(chrome::DIR_COMPONENT_WIDEVINE_CDM, + user_data_path.Append(kWidevineCdmBaseDirectory)); + } #endif // defined(WIDEVINE_CDM_IS_COMPONENT) #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) - } if (command_line->HasSwitch(switches::kDisablePackLoading))