[geary/wip/conditional-webkit-shared-proc] Conditionally enable WebKitGTK shared secondary process model
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/conditional-webkit-shared-proc] Conditionally enable WebKitGTK shared secondary process model
- Date: Wed, 11 Sep 2019 01:17:51 +0000 (UTC)
commit 439622caa9df0c3011b4fab3a04468aee24f02cf
Author: Michael Gratton <mike vee net>
Date: Wed Sep 11 11:10:47 2019 +1000
Conditionally enable WebKitGTK shared secondary process model
If compiling against WebKitGTK <= 2.24.x, enable the shared secondary
process model so we can build 3.34 for Flathub against 2.24 until
a fix for https://bugs.webkit.org/show_bug.cgi?id=201451 has been
released.
See issues #558 and #559, also #561
src/client/components/client-web-view.vala | 5 +++++
src/client/meson.build | 10 ++++++++++
2 files changed, 15 insertions(+)
---
diff --git a/src/client/components/client-web-view.vala b/src/client/components/client-web-view.vala
index 0505b9aa..98d7bff7 100644
--- a/src/client/components/client-web-view.vala
+++ b/src/client/components/client-web-view.vala
@@ -76,6 +76,11 @@ public abstract class ClientWebView : WebKit.WebView, Geary.BaseInterface {
File cache_dir) {
WebsiteDataManager data_manager = new WebsiteDataManager(cache_dir.get_path());
WebKit.WebContext context = new WebKit.WebContext.with_website_data_manager(data_manager);
+#if HAS_WEBKIT_SHARED_PROC
+ // Use a shared process so we don't spawn N WebProcess instances
+ // when showing N messages in a conversation.
+ context.set_process_model(WebKit.ProcessModel.SHARED_SECONDARY_PROCESS);
+#endif
// Use the doc viewer model since each web view instance only
// ever shows a single HTML document.
context.set_cache_model(WebKit.CacheModel.DOCUMENT_VIEWER);
diff --git a/src/client/meson.build b/src/client/meson.build
index d9008968..cc0129f6 100644
--- a/src/client/meson.build
+++ b/src/client/meson.build
@@ -148,6 +148,16 @@ if libunity.found()
geary_client_vala_options += ['-D', 'HAVE_LIBUNITY']
endif
+# Enable shared shecondary process if available.
+# See issues #558 and #559
+webkit_version = webkit2gtk.version().split('.')
+if webkit_version[0].to_int() <= 2 and webkit_version[1].to_int() <= 24
+ message('Enabling WebKitGTK shared process model')
+ geary_client_vala_options += [
+ '-D', 'HAS_WEBKIT_SHARED_PROC'
+ ]
+endif
+
# Main client application library
geary_client_lib = static_library('geary-client',
geary_client_sources,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]