summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2020-04-09 12:44:09 +0200
committerJüri Valdmann <juri.valdmann@qt.io>2020-04-14 11:36:32 +0000
commit757b9f459d3770644ad83d2faf26a7539c65023f (patch)
treef123b49264759633e040d9822ff2c1230b2ac4c9
parentc81ff02d7fc7695a62d6543e34b73a75071f7d78 (diff)
downloadqtwebengine-chromium-757b9f459d3770644ad83d2faf26a7539c65023f.tar.gz
Expose WebPreferences::disable_features_depending_on_viz
Normally only defined on Android, but we need it too. Task-number: QTBUG-56147 Change-Id: Ibe9f433011524c894045a294117f8f9d1d9b1a1e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--chromium/content/public/common/common_param_traits_macros.h4
-rw-r--r--chromium/content/public/common/web_preferences.cc4
-rw-r--r--chromium/content/public/common/web_preferences.h4
-rw-r--r--chromium/content/renderer/render_view_impl.cc4
4 files changed, 16 insertions, 0 deletions
diff --git a/chromium/content/public/common/common_param_traits_macros.h b/chromium/content/public/common/common_param_traits_macros.h
index b27f8b3a1a4..5387f7776df 100644
--- a/chromium/content/public/common/common_param_traits_macros.h
+++ b/chromium/content/public/common/common_param_traits_macros.h
@@ -233,7 +233,11 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(immersive_mode_enabled)
IPC_STRUCT_TRAITS_MEMBER(css_hex_alpha_color_enabled)
IPC_STRUCT_TRAITS_MEMBER(scroll_top_left_interop_enabled)
+#endif
+#if defined(OS_ANDROID) || defined(TOOLKIT_QT)
IPC_STRUCT_TRAITS_MEMBER(disable_features_depending_on_viz)
+#endif
+#if defined(OS_ANDROID)
IPC_STRUCT_TRAITS_MEMBER(disable_accelerated_small_canvases)
IPC_STRUCT_TRAITS_MEMBER(reenable_web_components_v0)
#endif // defined(OS_ANDROID)
diff --git a/chromium/content/public/common/web_preferences.cc b/chromium/content/public/common/web_preferences.cc
index 26b325d0e33..6db262aeeb3 100644
--- a/chromium/content/public/common/web_preferences.cc
+++ b/chromium/content/public/common/web_preferences.cc
@@ -206,7 +206,11 @@ WebPreferences::WebPreferences()
embedded_media_experience_enabled(false),
css_hex_alpha_color_enabled(true),
scroll_top_left_interop_enabled(true),
+#endif
+#if defined(OS_ANDROID) || defined(TOOLKIT_QT)
disable_features_depending_on_viz(false),
+#endif
+#if defined(OS_ANDROID)
disable_accelerated_small_canvases(false),
reenable_web_components_v0(false),
#endif // defined(OS_ANDROID)
diff --git a/chromium/content/public/common/web_preferences.h b/chromium/content/public/common/web_preferences.h
index 2cea40b9f67..20832410d21 100644
--- a/chromium/content/public/common/web_preferences.h
+++ b/chromium/content/public/common/web_preferences.h
@@ -275,10 +275,14 @@ struct CONTENT_EXPORT WebPreferences {
// WebView sets this to false to retain old documentElement behaviour
// (http://crbug.com/761016).
bool scroll_top_left_interop_enabled;
+#endif
+#if defined(OS_ANDROID) || defined(TOOLKIT_QT)
// Disable features such as offscreen canvas that depend on the viz
// architecture of surface embedding. Android WebView does not support this
// architecture yet.
bool disable_features_depending_on_viz;
+#endif
+#if defined(OS_ANDROID)
// Don't accelerate small canvases to avoid crashes TODO(crbug.com/1004304)
bool disable_accelerated_small_canvases;
// Re-enable Web Components v0 on Webview, temporarily. This should get
diff --git a/chromium/content/renderer/render_view_impl.cc b/chromium/content/renderer/render_view_impl.cc
index 616ab465bb9..4e9cf88b570 100644
--- a/chromium/content/renderer/render_view_impl.cc
+++ b/chromium/content/renderer/render_view_impl.cc
@@ -854,8 +854,12 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
WebRuntimeFeatures::EnableCSSHexAlphaColor(prefs.css_hex_alpha_color_enabled);
WebRuntimeFeatures::EnableScrollTopLeftInterop(
prefs.scroll_top_left_interop_enabled);
+#endif
+#if defined(OS_ANDROID) || defined(TOOLKIT_QT)
WebRuntimeFeatures::EnableSurfaceEmbeddingFeatures(
!prefs.disable_features_depending_on_viz);
+#endif
+#if defined(OS_ANDROID)
WebRuntimeFeatures::EnableAcceleratedSmallCanvases(
!prefs.disable_accelerated_small_canvases);
if (prefs.reenable_web_components_v0) {