[epiphany] Add a setting to set the maximum number of web processes



commit 74e1ff0dd50afc3450eb494dc3c6f5ac0c00b2f5
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Fri Jul 31 09:55:19 2015 +0200

    Add a setting to set the maximum number of web processes
    
    It allows to limit the amount of web processes created at the same time
    by the one-secondary-process-per-web-view process model.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753092

 configure.ac                        |    2 +-
 data/org.gnome.epiphany.gschema.xml |    6 ++++++
 embed/ephy-embed-shell.c            |    2 ++
 lib/ephy-prefs.h                    |    1 +
 4 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6597911..0e73b51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,7 +77,7 @@ GLIB_REQUIRED=2.38.0
 GTK_REQUIRED=3.13.0
 LIBXML_REQUIRED=2.6.12
 LIBXSLT_REQUIRED=1.1.7
-WEBKIT_GTK_REQUIRED=2.9.4
+WEBKIT_GTK_REQUIRED=2.9.5
 LIBSOUP_REQUIRED=2.48.0
 GNOME_DESKTOP_REQUIRED=2.91.2
 LIBSECRET_REQUIRED=0.14
diff --git a/data/org.gnome.epiphany.gschema.xml b/data/org.gnome.epiphany.gschema.xml
index d69c37c..7a1f103 100644
--- a/data/org.gnome.epiphany.gschema.xml
+++ b/data/org.gnome.epiphany.gschema.xml
@@ -71,6 +71,12 @@
                         <summary>Process model</summary>
                         <description>This option allows to set the process model used. Use 
'shared-secondary-process' to use a single web process shared by all the tabs and 
'one-secondary-process-per-web-view' to use a different web process for each tab.</description>
                 </key>
+                <key type="u" name="max-processes">
+                        <default>0</default>
+                        <summary>Maximum number of web processes created at the same time when using 
'one-secondary-process-per-web-view' model</summary>
+                        <description>This option sets a limit to the number of web processes that will be 
used at the same time for the 'one-secondary-process-per-web-view' model. The default value is '0' and means 
no limit.</description>
+
+                </key>
        </schema>
        <schema path="/org/gnome/epiphany/ui/" id="org.gnome.Epiphany.ui">
                <key type="b" name="always-show-tabs-bar">
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 54cae19..1a9b9a9 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -564,6 +564,8 @@ ephy_embed_shell_setup_process_model (EphyEmbedShell *shell)
   case EPHY_PREFS_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW:
     webkit_web_context_set_process_model (shell->priv->web_context,
                                           WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
+    webkit_web_context_set_web_process_count_limit (shell->priv->web_context,
+                                                    g_settings_get_uint (EPHY_SETTINGS_MAIN, 
EPHY_PREFS_MAX_PROCESSES));
     break;
   }
 }
diff --git a/lib/ephy-prefs.h b/lib/ephy-prefs.h
index 8f0ba5a..10adbc5 100644
--- a/lib/ephy-prefs.h
+++ b/lib/ephy-prefs.h
@@ -106,6 +106,7 @@ typedef enum
 #define EPHY_PREFS_RESTORE_SESSION_POLICY         "restore-session-policy"
 #define EPHY_PREFS_RESTORE_SESSION_DELAYING_LOADS "restore-session-delaying-loads"
 #define EPHY_PREFS_PROCESS_MODEL                  "process-model"
+#define EPHY_PREFS_MAX_PROCESSES                  "max-processes"
 
 #define EPHY_PREFS_LOCKDOWN_SCHEMA            "org.gnome.Epiphany.lockdown"
 #define EPHY_PREFS_LOCKDOWN_FULLSCREEN        "disable-fullscreen"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]