mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			50 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| diff --git chrome/common/media/component_widevine_cdm_hint_file_linux.cc chrome/common/media/component_widevine_cdm_hint_file_linux.cc
 | |
| index c416845d817fe..f940dd80e2ed4 100644
 | |
| --- chrome/common/media/component_widevine_cdm_hint_file_linux.cc
 | |
| +++ chrome/common/media/component_widevine_cdm_hint_file_linux.cc
 | |
| @@ -18,6 +18,7 @@
 | |
|  #include "base/values.h"
 | |
|  #include "base/version.h"
 | |
|  #include "chrome/common/chrome_paths.h"
 | |
| +#include "third_party/widevine/cdm/widevine_cdm_common.h"
 | |
|  
 | |
|  namespace {
 | |
|  
 | |
| @@ -25,6 +26,26 @@ namespace {
 | |
|  const char kPath[] = "Path";
 | |
|  const char kLastBundledVersion[] = "LastBundledVersion";
 | |
|  
 | |
| +// On Linux the Widevine CDM is loaded into the zygote at startup. When the
 | |
| +// component updater runs sometime later and finds a newer version of the
 | |
| +// Widevine CDM, don't register it as the newer version can't be used. Instead,
 | |
| +// save the path to the new Widevine CDM in this file. Next time at startup this
 | |
| +// file will be checked, and if it references a usable Widevine CDM, use this
 | |
| +// version instead of the old (potentially bundled) CDM.
 | |
| +// Add this method instead of using chrome::FILE_COMPONENT_WIDEVINE_CDM_HINT
 | |
| +// because only directories (not files) can be configured via
 | |
| +// base::PathService::Override.
 | |
| +bool GetHintFilePath(base::FilePath* hint_file_path) {
 | |
| +  base::FilePath user_data_dir;
 | |
| +  if (!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir))
 | |
| +    return false;
 | |
| +  // Match the file name in chrome/common/chrome_paths.cc
 | |
| +  *hint_file_path = user_data_dir
 | |
| +      .AppendASCII(kWidevineCdmBaseDirectory)
 | |
| +      .Append(FILE_PATH_LITERAL("latest-component-updated-widevine-cdm"));
 | |
| +  return true;
 | |
| +}
 | |
| +
 | |
|  // Returns the hint file contents as a Value::Dict. Returned result may be an
 | |
|  // empty dictionary if the hint file does not exist or is formatted incorrectly.
 | |
|  base::Value::Dict GetHintFileContents() {
 | |
| @@ -65,8 +86,7 @@ bool UpdateWidevineCdmHintFile(const base::FilePath& cdm_base_path,
 | |
|    DCHECK(!cdm_base_path.empty());
 | |
|  
 | |
|    base::FilePath hint_file_path;
 | |
| -  CHECK(base::PathService::Get(chrome::FILE_COMPONENT_WIDEVINE_CDM_HINT,
 | |
| -                               &hint_file_path));
 | |
| +  CHECK(GetHintFilePath(&hint_file_path));
 | |
|  
 | |
|    base::Value::Dict dict;
 | |
|    dict.Set(kPath, cdm_base_path.value());
 |