From 77466e7b6d4de25c534dd3b2ccfcd663b64b6879 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 24 Mar 2022 12:16:08 -0400 Subject: [PATCH] alloy: Use chrome's value for ApplicationClientIdForFileScanning (fixes issue #3030) This change removes CefSettings.application_client_id_for_file_scanning in favor of always using the same hard-coded value as chrome. --- include/cef_api_hash.h | 8 ++++---- include/internal/cef_types.h | 8 -------- include/internal/cef_types_wrappers.h | 5 ----- libcef/browser/download_manager_delegate.cc | 7 +------ tests/cefclient/cefclient_win.cc | 4 ---- 5 files changed, 5 insertions(+), 27 deletions(-) diff --git a/include/cef_api_hash.h b/include/cef_api_hash.h index b60d4051b..ab5e71ba7 100644 --- a/include/cef_api_hash.h +++ b/include/cef_api_hash.h @@ -42,13 +42,13 @@ // way that may cause binary incompatibility with other builds. The universal // hash value will change if any platform is affected whereas the platform hash // values will change only if that particular platform is affected. -#define CEF_API_HASH_UNIVERSAL "e42afcebc271841716a6f3197194e3ea02d037cb" +#define CEF_API_HASH_UNIVERSAL "b48260d601003581ec2c9e73c929334503fcde08" #if defined(OS_WIN) -#define CEF_API_HASH_PLATFORM "e08d5cc79cedebc94efc39536c27b6c30d24c9df" +#define CEF_API_HASH_PLATFORM "e65308c28b7ee4ac8f381ae05ab8a7032530c802" #elif defined(OS_MAC) -#define CEF_API_HASH_PLATFORM "86626c6c27b29841a4bf01c145e2d7990a73abf0" +#define CEF_API_HASH_PLATFORM "969a1ae6e43f5b11a67a38a54ce2fc885a1f234d" #elif defined(OS_LINUX) -#define CEF_API_HASH_PLATFORM "a19b7983d07d0e6afe0ae46c1768111078995c5e" +#define CEF_API_HASH_PLATFORM "a4814c14fa26251da02fd92ebbb3db8f07646110" #endif #ifdef __cplusplus diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index 6e435a2a7..2fd450c4b 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -426,14 +426,6 @@ typedef struct _cef_settings_t { /// cef_string_t cookieable_schemes_list; int cookieable_schemes_exclude_defaults; - - /// - // GUID string used for identifying the application. This is passed to the - // system AV function for scanning downloaded files. By default, the GUID - // will be an empty string and the file will be treated as an untrusted - // file when the GUID is empty. - /// - cef_string_t application_client_id_for_file_scanning; } cef_settings_t; /// diff --git a/include/internal/cef_types_wrappers.h b/include/internal/cef_types_wrappers.h index 89c90a023..4ab3effa1 100644 --- a/include/internal/cef_types_wrappers.h +++ b/include/internal/cef_types_wrappers.h @@ -546,7 +546,6 @@ struct CefSettingsTraits { cef_string_clear(&s->locales_dir_path); cef_string_clear(&s->accept_language_list); cef_string_clear(&s->cookieable_schemes_list); - cef_string_clear(&s->application_client_id_for_file_scanning); } static inline void set(const struct_type* src, @@ -605,10 +604,6 @@ struct CefSettingsTraits { &target->cookieable_schemes_list, copy); target->cookieable_schemes_exclude_defaults = src->cookieable_schemes_exclude_defaults; - - cef_string_set(src->application_client_id_for_file_scanning.str, - src->application_client_id_for_file_scanning.length, - &target->application_client_id_for_file_scanning, copy); } }; diff --git a/libcef/browser/download_manager_delegate.cc b/libcef/browser/download_manager_delegate.cc index e4b053e1c..e63281daf 100644 --- a/libcef/browser/download_manager_delegate.cc +++ b/libcef/browser/download_manager_delegate.cc @@ -405,12 +405,7 @@ void CefDownloadManagerDelegate::GetNextId( } std::string CefDownloadManagerDelegate::ApplicationClientIdForFileScanning() { - const CefSettings& settings = CefContext::Get()->settings(); - if (settings.application_client_id_for_file_scanning.length > 0) { - return CefString(&settings.application_client_id_for_file_scanning) - .ToString(); - } - return std::string(); + return std::string(chrome::kApplicationClientIDStringForAVScanning); } void CefDownloadManagerDelegate::OnBrowserDestroyed( diff --git a/tests/cefclient/cefclient_win.cc b/tests/cefclient/cefclient_win.cc index 631370122..77d59c3fe 100644 --- a/tests/cefclient/cefclient_win.cc +++ b/tests/cefclient/cefclient_win.cc @@ -77,10 +77,6 @@ int RunMain(HINSTANCE hInstance, int nCmdShow) { settings.no_sandbox = true; #endif - // Applications should specify a unique GUID here to enable trusted downloads. - CefString(&settings.application_client_id_for_file_scanning) - .FromString("9A8DE24D-B822-4C6C-8259-5A848FEA1E68"); - // Populate the settings based on command line arguments. context->PopulateSettings(&settings);