Title: [249419] trunk
Revision
249419
Author
carlo...@webkit.org
Date
2019-09-03 02:57:32 -0700 (Tue, 03 Sep 2019)

Log Message

[WPE][GTK] Deprecate nonfunctional process limit APIs
https://bugs.webkit.org/show_bug.cgi?id=193749

Reviewed by Žan Doberšek.

Source/WebKit:

* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkit_web_context_set_process_model):
(webkit_web_context_get_process_model):
(webkit_web_context_set_web_process_count_limit):
(webkit_web_context_get_web_process_count_limit):
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/wpe/WebKitWebContext.h:

Tools:

* MiniBrowser/gtk/main.c:
(main):
* TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp:
(beforeAll):
(testWebProcessLimit): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (249418 => 249419)


--- trunk/Source/WebKit/ChangeLog	2019-09-03 07:26:55 UTC (rev 249418)
+++ trunk/Source/WebKit/ChangeLog	2019-09-03 09:57:32 UTC (rev 249419)
@@ -1,3 +1,19 @@
+2019-09-03  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [WPE][GTK] Deprecate nonfunctional process limit APIs
+        https://bugs.webkit.org/show_bug.cgi?id=193749
+
+        Reviewed by Žan Doberšek.
+
+        * UIProcess/API/glib/WebKitWebContext.cpp:
+        (webkitWebContextConstructed):
+        (webkit_web_context_set_process_model):
+        (webkit_web_context_get_process_model):
+        (webkit_web_context_set_web_process_count_limit):
+        (webkit_web_context_get_web_process_count_limit):
+        * UIProcess/API/gtk/WebKitWebContext.h:
+        * UIProcess/API/wpe/WebKitWebContext.h:
+
 2019-09-02  Youenn Fablet  <you...@apple.com>
 
         Make NetworkConnectionToWebProcess keyed by their WebProcess identifier

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp (249418 => 249419)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp	2019-09-03 07:26:55 UTC (rev 249418)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp	2019-09-03 09:57:32 UTC (rev 249419)
@@ -176,7 +176,6 @@
     CString faviconDatabaseDirectory;
     WebKitTLSErrorsPolicy tlsErrorsPolicy;
     WebKitProcessModel processModel;
-    unsigned processCountLimit;
 
     HashMap<uint64_t, WebKitWebView*> webViews;
     unsigned ephemeralPageCount;
@@ -359,6 +358,8 @@
     priv->tlsErrorsPolicy = WEBKIT_TLS_ERRORS_POLICY_FAIL;
     priv->processPool->setIgnoreTLSErrors(false);
 
+    priv->processModel = WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES;
+
 #if ENABLE(MEMORY_SAMPLER)
     if (getenv("WEBKIT_SAMPLE_MEMORY"))
         priv->processPool->startMemorySampler(0);
@@ -1526,14 +1527,9 @@
  * @process_model: a #WebKitProcessModel
  *
  * Specifies a process model for WebViews, which WebKit will use to
- * determine how auxiliary processes are handled. The default setting
- * (%WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS) is suitable for most
- * applications which embed a small amount of WebViews, or are used to
- * display documents which are considered safe — like local files.
+ * determine how auxiliary processes are handled.
  *
- * Applications which may potentially use a large amount of WebViews
- * —for example a multi-tabbed web browser— may want to use
- * %WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES, which will use
+ * %WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES will use
  * one process per view most of the time, while still allowing for web
  * views to share a process when needed (for example when different
  * views interact with each other). Using this model, when a process
@@ -1541,6 +1537,9 @@
  * the rest of the WebViews in the application will still function
  * normally.
  *
+ * %WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS is deprecated since 2.26,
+ * using it has no effect for security reasons.
+ *
  * This method **must be called before any web process has been created**,
  * as early as possible in your application. Calling it later will make
  * your application crash.
@@ -1551,6 +1550,11 @@
 {
     g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));
 
+    if (processModel == WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS) {
+        g_warning("WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS is deprecated and has no effect");
+        return;
+    }
+
     if (processModel == context->priv->processModel)
         return;
 
@@ -1570,7 +1574,7 @@
  */
 WebKitProcessModel webkit_web_context_get_process_model(WebKitWebContext* context)
 {
-    g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS);
+    g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
 
     return context->priv->processModel;
 }
@@ -1583,20 +1587,17 @@
  * Sets the maximum number of web processes that can be created at the same time for the @context.
  * The default value is 0 and means no limit.
  *
- * This method **must be called before any web process has been created**,
- * as early as possible in your application. Calling it later will make
- * your application crash.
+ * This function is now deprecated and does nothing for security reasons.
  *
  * Since: 2.10
+ *
+ * Deprecated: 2.26
  */
 void webkit_web_context_set_web_process_count_limit(WebKitWebContext* context, guint limit)
 {
     g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));
 
-    if (context->priv->processCountLimit == limit)
-        return;
-
-    context->priv->processCountLimit = limit;
+    g_warning("webkit_web_context_set_web_process_count_limit is deprecated and does nothing. Limiting the number of web processes is no longer possible for security reasons");
 }
 
 /**
@@ -1605,15 +1606,19 @@
  *
  * Gets the maximum number of web processes that can be created at the same time for the @context.
  *
+ * This function is now deprecated and always returns 0 (no limit). See also webkit_web_context_set_web_process_count_limit().
+ *
  * Returns: the maximum limit of web processes, or 0 if there isn't a limit.
  *
  * Since: 2.10
+ *
+ * Deprecated: 2.26
  */
 guint webkit_web_context_get_web_process_count_limit(WebKitWebContext* context)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), 0);
 
-    return context->priv->processCountLimit;
+    return 0;
 }
 
 static void addOriginToMap(WebKitSecurityOrigin* origin, HashMap<String, bool>* map, bool allowed)

Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h (249418 => 249419)


--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h	2019-09-03 07:26:55 UTC (rev 249418)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h	2019-09-03 09:57:32 UTC (rev 249419)
@@ -67,11 +67,7 @@
 
 /**
  * WebKitProcessModel:
- * @WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS: Use a single process to
- *   perform content rendering. The process is shared among all the
- *   #WebKitWebView instances created by the application: if the process
- *   hangs or crashes all the web views in the application will be affected.
- *   This is the default process model, and it should suffice for most cases.
+ * @WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS: Deprecated 2.26.
  * @WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES: Use one process
  *   for each #WebKitWebView, while still allowing for some of them to
  *   share a process in certain situations. The main advantage
@@ -193,11 +189,11 @@
 WEBKIT_API WebKitCacheModel
 webkit_web_context_get_cache_model                  (WebKitWebContext              *context);
 
-WEBKIT_API void
+WEBKIT_DEPRECATED void
 webkit_web_context_set_web_process_count_limit      (WebKitWebContext              *context,
                                                      guint                          limit);
 
-WEBKIT_API guint
+WEBKIT_DEPRECATED guint
 webkit_web_context_get_web_process_count_limit      (WebKitWebContext              *context);
 
 WEBKIT_API void

Modified: trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h (249418 => 249419)


--- trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h	2019-09-03 07:26:55 UTC (rev 249418)
+++ trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h	2019-09-03 09:57:32 UTC (rev 249419)
@@ -67,11 +67,7 @@
 
 /**
  * WebKitProcessModel:
- * @WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS: Use a single process to
- *   perform content rendering. The process is shared among all the
- *   #WebKitWebView instances created by the application: if the process
- *   hangs or crashes all the web views in the application will be affected.
- *   This is the default process model, and it should suffice for most cases.
+ * @WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS: Deprecated 2.26.
  * @WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES: Use one process
  *   for each #WebKitWebView, while still allowing for some of them to
  *   share a process in certain situations. The main advantage
@@ -193,11 +189,11 @@
 WEBKIT_API WebKitCacheModel
 webkit_web_context_get_cache_model                  (WebKitWebContext              *context);
 
-WEBKIT_API void
+WEBKIT_DEPRECATED void
 webkit_web_context_set_web_process_count_limit      (WebKitWebContext              *context,
                                                      guint                          limit);
 
-WEBKIT_API guint
+WEBKIT_DEPRECATED guint
 webkit_web_context_get_web_process_count_limit      (WebKitWebContext              *context);
 
 WEBKIT_API void

Modified: trunk/Tools/ChangeLog (249418 => 249419)


--- trunk/Tools/ChangeLog	2019-09-03 07:26:55 UTC (rev 249418)
+++ trunk/Tools/ChangeLog	2019-09-03 09:57:32 UTC (rev 249419)
@@ -1,3 +1,16 @@
+2019-09-03  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [WPE][GTK] Deprecate nonfunctional process limit APIs
+        https://bugs.webkit.org/show_bug.cgi?id=193749
+
+        Reviewed by Žan Doberšek.
+
+        * MiniBrowser/gtk/main.c:
+        (main):
+        * TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp:
+        (beforeAll):
+        (testWebProcessLimit): Deleted.
+
 2019-09-02  Zan Dobersek  <zdober...@igalia.com>
 
         [WPE] WindowBackend should do resizing properly

Modified: trunk/Tools/MiniBrowser/gtk/main.c (249418 => 249419)


--- trunk/Tools/MiniBrowser/gtk/main.c	2019-09-03 07:26:55 UTC (rev 249418)
+++ trunk/Tools/MiniBrowser/gtk/main.c	2019-09-03 09:57:32 UTC (rev 249419)
@@ -552,10 +552,6 @@
         webkit_network_proxy_settings_free(webkitProxySettings);
     }
 
-    const gchar *singleprocess = g_getenv("MINIBROWSER_SINGLEPROCESS");
-    webkit_web_context_set_process_model(webContext, (singleprocess && *singleprocess) ?
-        WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS : WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
-
     // Enable the favicon database, by specifying the default directory.
     webkit_web_context_set_favicon_database_directory(webContext, NULL);
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp (249418 => 249419)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp	2019-09-03 07:26:55 UTC (rev 249418)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp	2019-09-03 09:57:32 UTC (rev 249419)
@@ -61,11 +61,11 @@
         m_webViews[index] = Test::adoptView(Test::createWebView(m_webContext.get()));
         assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_webViews[index].get()));
 
-        m_webViewBusNames[index] = GUniquePtr<char>(g_strdup_printf("org.webkit.gtk.WebExtensionTest%u", Test::s_webExtensionID));
-
         webkit_web_view_load_html(m_webViews[index].get(), "<html></html>", nullptr);
         g_signal_connect(m_webViews[index].get(), "load-changed", G_CALLBACK(loadChanged), this);
         g_main_loop_run(m_mainLoop);
+
+        m_webViewBusNames[index] = GUniquePtr<char>(g_strdup_printf("org.webkit.gtk.WebExtensionTest%u", Test::s_webExtensionID));
     }
 
     unsigned webProcessPid(unsigned index)
@@ -248,35 +248,11 @@
     g_assert_cmpuint(test->m_initializeWebExtensionsSignalCount, ==, 1);
 }
 
-static void testWebProcessLimit(MultiprocessTest* test, gconstpointer)
-{
-    g_assert_cmpuint(webkit_web_context_get_web_process_count_limit(test->m_webContext.get()), ==, 0);
-
-    webkit_web_context_set_web_process_count_limit(test->m_webContext.get(), 1);
-    g_assert_cmpuint(webkit_web_context_get_web_process_count_limit(test->m_webContext.get()), ==, 1);
-
-    // Create two web views but there should be only one web process.
-    for (unsigned i = 0; i < numViews; i++) {
-        test->loadWebViewAndWaitUntilLoaded(i);
-        g_assert_true(WEBKIT_IS_WEB_VIEW(test->m_webViews[i].get()));
-    }
-
-    g_assert_cmpuint(test->m_initializeWebExtensionsSignalCount, ==, 1);
-}
-
 void beforeAll()
 {
     // Check that default setting is the one stated in the documentation
-    g_assert_cmpuint(webkit_web_context_get_process_model(webkit_web_context_get_default()),
-        ==, WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS);
+    g_assert_cmpuint(webkit_web_context_get_process_model(webkit_web_context_get_default()), ==, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
 
-    webkit_web_context_set_process_model(webkit_web_context_get_default(),
-        WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
-
-    // Check that the getter returns the newly-set value
-    g_assert_cmpuint(webkit_web_context_get_process_model(webkit_web_context_get_default()),
-        ==, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
-
     bus = new WebKitTestBus();
     if (!bus->run())
         return;
@@ -283,7 +259,6 @@
 
     MultiprocessTest::add("WebKitWebContext", "process-per-web-view", testProcessPerWebView);
     UIClientMultiprocessTest::add("WebKitWebView", "multiprocess-create-ready-close", testMultiprocessWebViewCreateReadyClose);
-    MultiprocessTest::add("WebKitWebContext", "web-process-limit", testWebProcessLimit);
 }
 
 void afterAll()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to