Remove CefBrowserSettings.application_cache (fixes issue #1785)

AppCache is deprecated in favor of Service Workers and support will be
fully removed soon (~M95). See https://web.dev/appcache-removal/.

Also add missing "allow-file-access-from-files" command-line switch for
CefBrowserSettings.file_access_from_file_urls.
This commit is contained in:
Marshall Greenblatt 2021-09-27 13:03:32 +03:00
parent cbc5710801
commit 6516b569a9
6 changed files with 11 additions and 13 deletions

View File

@ -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 "7bc6f4ca51afa11542e22d0a3b1ccb796fa0aaa1"
#define CEF_API_HASH_UNIVERSAL "d158dd50a51d3338248731969e8154e92abda022"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "b5f894040c9668ed03c19976275e0611cd24b0c0"
#define CEF_API_HASH_PLATFORM "657f400c514c841adc27fb29142d5ad4806e1db5"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "539d29daac8c7aa3ed8c19fedbb2effdc58d33d2"
#define CEF_API_HASH_PLATFORM "6e88cf614e9c742b0b50b25e6cf4a22afec3aae5"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "fe6dd0bea2361d1b5eddd10035d5aa8cd31a552c"
#define CEF_API_HASH_PLATFORM "5a8b9f7961b2ebf85c5fed71eccfeb2c858c9a5a"
#endif
#ifdef __cplusplus

View File

@ -611,7 +611,7 @@ typedef struct _cef_browser_settings_t {
///
// Controls whether file URLs will have access to other file URLs. Also
// configurable using the "allow-access-from-files" command-line switch.
// configurable using the "allow-file-access-from-files" command-line switch.
///
cef_state_t file_access_from_file_urls;
@ -653,12 +653,6 @@ typedef struct _cef_browser_settings_t {
///
cef_state_t databases;
///
// Controls whether the application cache can be used. Also configurable using
// the "disable-application-cache" command-line switch.
///
cef_state_t application_cache;
///
// Controls whether WebGL can be used. Note that WebGL requires hardware
// support and may not work on all systems even when enabled. Also

View File

@ -717,7 +717,6 @@ struct CefBrowserSettingsTraits {
target->tab_to_links = src->tab_to_links;
target->local_storage = src->local_storage;
target->databases = src->databases;
target->application_cache = src->application_cache;
target->webgl = src->webgl;
target->background_color = src->background_color;

View File

@ -261,6 +261,8 @@ void SetDefaultPrefs(blink::web_pref::WebPreferences& web) {
!command_line->HasSwitch(switches::kDisableJavascriptAccessClipboard);
web.allow_universal_access_from_file_urls =
command_line->HasSwitch(switches::kAllowUniversalAccessFromFileUrls);
web.allow_file_access_from_file_urls =
command_line->HasSwitch(switches::kAllowFileAccessFromFileUrls);
web.shrinks_standalone_images_to_fit =
command_line->HasSwitch(switches::kImageShrinkStandaloneToFit);
web.text_areas_are_resizable =
@ -332,7 +334,6 @@ void SetCefPrefs(const CefBrowserSettings& cef,
SET_STATE(cef.tab_to_links, web.tabs_to_links);
SET_STATE(cef.local_storage, web.local_storage_enabled);
SET_STATE(cef.databases, web.databases_enabled);
SET_STATE(cef.application_cache, web.application_cache_enabled);
// Never explicitly enable GPU-related functions in this method because the
// GPU blacklist is not being checked here.

View File

@ -48,6 +48,9 @@ const char kDisableJavascriptDomPaste[] = "disable-javascript-dom-paste";
const char kAllowUniversalAccessFromFileUrls[] =
"allow-universal-access-from-files";
// Allow access from file URLs.
const char kAllowFileAccessFromFileUrls[] = "allow-file-access-from-files";
// Disable loading of images from the network. A cached image will still be
// rendered if requested.
const char kDisableImageLoading[] = "disable-image-loading";

View File

@ -29,6 +29,7 @@ extern const char kDisableJavascriptCloseWindows[];
extern const char kDisableJavascriptAccessClipboard[];
extern const char kDisableJavascriptDomPaste[];
extern const char kAllowUniversalAccessFromFileUrls[];
extern const char kAllowFileAccessFromFileUrls[];
extern const char kDisableImageLoading[];
extern const char kImageShrinkStandaloneToFit[];
extern const char kDisableTextAreaResize[];