[epiphany/carlosgc/pson: 2/2] Enable Process Swap On (Cross-site) Navigation



commit 6c849efc4b54f90eaa57c4314348b5ce23d0baa6
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Thu Nov 28 12:07:51 2019 +0100

    Enable Process Swap On (Cross-site) Navigation

 embed/ephy-embed-shell.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 697b04f85..b3d8c9237 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -758,22 +758,21 @@ ephy_embed_shell_create_web_context (EphyEmbedShell *shell)
   EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
   g_autoptr (WebKitWebsiteDataManager) manager = NULL;
 
-  if (priv->mode == EPHY_EMBED_SHELL_MODE_INCOGNITO) {
-    priv->web_context = webkit_web_context_new_ephemeral ();
-    return;
-  }
-
-  if (priv->mode == EPHY_EMBED_SHELL_MODE_AUTOMATION) {
-    priv->web_context = webkit_web_context_new_ephemeral ();
-    webkit_web_context_set_automation_allowed (priv->web_context, TRUE);
-    return;
+  if (priv->mode == EPHY_EMBED_SHELL_MODE_INCOGNITO || priv->mode == EPHY_EMBED_SHELL_MODE_AUTOMATION) {
+    manager = webkit_website_data_manager_new_ephemeral ();
+  } else {
+    manager = webkit_website_data_manager_new ("base-data-directory", ephy_profile_dir (),
+                                               "base-cache-directory", ephy_cache_dir (),
+                                               NULL);
   }
 
-  manager = webkit_website_data_manager_new ("base-data-directory", ephy_profile_dir (),
-                                             "base-cache-directory", ephy_cache_dir (),
-                                             NULL);
+  priv->web_context = g_object_new (WEBKIT_TYPE_WEB_CONTEXT,
+                                    "website-data-manager", manager,
+                                    "process-swap-on-cross-site-navigation-enabled", TRUE,
+                                    NULL);
 
-  priv->web_context = webkit_web_context_new_with_website_data_manager (manager);
+  if (priv->mode == EPHY_EMBED_SHELL_MODE_AUTOMATION)
+    webkit_web_context_set_automation_allowed (priv->web_context, TRUE);
 }
 
 static void


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