widevine: Use component updater with the Alloy runtime (fixes issue #3149)

Widevine CDM binaries will be downloaded on supported platforms shortly after
application startup. Widevine support will then become available within a few
seconds after successful installation on Windows or after the next application
restart on other platforms. The CDM files will be downloaded to a "WidevineCdm"
directory inside the `CefSettings.user_data_path` directory.

Pass the `--disable-component-update` command-line flag to disable Widevine
download and installation. Pass the `--component-updater=fast-update` command-
line flag to force Widevine download immediately after application startup.

See the related issue for additional usage details.
This commit is contained in:
Marshall Greenblatt
2021-08-09 17:18:43 -04:00
parent eaf581e544
commit 240b869db5
45 changed files with 201 additions and 1459 deletions

View File

@@ -29,6 +29,7 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/utility/chrome_content_utility_client.h"
#include "components/component_updater/component_updater_paths.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/embedder_support/switches.h"
#include "components/viz/common/features.h"
@@ -369,9 +370,10 @@ void AlloyMainDelegate::PreSandboxStartup() {
#endif
resource_util::OverrideDefaultDownloadDir();
resource_util::OverrideUserDataDir(settings_, command_line);
}
resource_util::OverrideUserDataDir(settings_, command_line);
if (command_line->HasSwitch(switches::kDisablePackLoading))
resource_bundle_delegate_.set_pack_loading_disabled(true);
@@ -379,6 +381,11 @@ void AlloyMainDelegate::PreSandboxStartup() {
// chrome::DIR_CRASH_DUMPS must be configured before calling this function.
crash_reporting::PreSandboxStartup(*command_line, process_type);
// Register the component_updater PathProvider.
component_updater::RegisterPathProvider(chrome::DIR_COMPONENTS,
chrome::DIR_INTERNAL_PLUGINS,
chrome::DIR_USER_DATA);
InitializeResourceBundle();
MaybeInitializeGDI();
}