Changeset 249419 in webkit
- Timestamp:
- Sep 3, 2019 2:57:32 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r249379 r249419 1 2019-09-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [WPE][GTK] Deprecate nonfunctional process limit APIs 4 https://bugs.webkit.org/show_bug.cgi?id=193749 5 6 Reviewed by Žan Doberšek. 7 8 * UIProcess/API/glib/WebKitWebContext.cpp: 9 (webkitWebContextConstructed): 10 (webkit_web_context_set_process_model): 11 (webkit_web_context_get_process_model): 12 (webkit_web_context_set_web_process_count_limit): 13 (webkit_web_context_get_web_process_count_limit): 14 * UIProcess/API/gtk/WebKitWebContext.h: 15 * UIProcess/API/wpe/WebKitWebContext.h: 16 1 17 2019-09-02 Youenn Fablet <youenn@apple.com> 2 18 -
trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
r249275 r249419 177 177 WebKitTLSErrorsPolicy tlsErrorsPolicy; 178 178 WebKitProcessModel processModel; 179 unsigned processCountLimit;180 179 181 180 HashMap<uint64_t, WebKitWebView*> webViews; … … 359 358 priv->tlsErrorsPolicy = WEBKIT_TLS_ERRORS_POLICY_FAIL; 360 359 priv->processPool->setIgnoreTLSErrors(false); 360 361 priv->processModel = WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES; 361 362 362 363 #if ENABLE(MEMORY_SAMPLER) … … 1527 1528 * 1528 1529 * Specifies a process model for WebViews, which WebKit will use to 1529 * determine how auxiliary processes are handled. The default setting 1530 * (%WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS) is suitable for most 1531 * applications which embed a small amount of WebViews, or are used to 1532 * display documents which are considered safe — like local files. 1533 * 1534 * Applications which may potentially use a large amount of WebViews 1535 * —for example a multi-tabbed web browser— may want to use 1536 * %WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES, which will use 1530 * determine how auxiliary processes are handled. 1531 * 1532 * %WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES will use 1537 1533 * one process per view most of the time, while still allowing for web 1538 1534 * views to share a process when needed (for example when different … … 1542 1538 * normally. 1543 1539 * 1540 * %WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS is deprecated since 2.26, 1541 * using it has no effect for security reasons. 1542 * 1544 1543 * This method **must be called before any web process has been created**, 1545 1544 * as early as possible in your application. Calling it later will make … … 1552 1551 g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context)); 1553 1552 1553 if (processModel == WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS) { 1554 g_warning("WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS is deprecated and has no effect"); 1555 return; 1556 } 1557 1554 1558 if (processModel == context->priv->processModel) 1555 1559 return; … … 1571 1575 WebKitProcessModel webkit_web_context_get_process_model(WebKitWebContext* context) 1572 1576 { 1573 g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), WEBKIT_PROCESS_MODEL_ SHARED_SECONDARY_PROCESS);1577 g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); 1574 1578 1575 1579 return context->priv->processModel; … … 1584 1588 * The default value is 0 and means no limit. 1585 1589 * 1586 * This method **must be called before any web process has been created**, 1587 * as early as possible in your application. Calling it later will make 1588 * your application crash. 1590 * This function is now deprecated and does nothing for security reasons. 1589 1591 * 1590 1592 * Since: 2.10 1593 * 1594 * Deprecated: 2.26 1591 1595 */ 1592 1596 void webkit_web_context_set_web_process_count_limit(WebKitWebContext* context, guint limit) … … 1594 1598 g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context)); 1595 1599 1596 if (context->priv->processCountLimit == limit) 1597 return; 1598 1599 context->priv->processCountLimit = limit; 1600 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"); 1600 1601 } 1601 1602 … … 1606 1607 * Gets the maximum number of web processes that can be created at the same time for the @context. 1607 1608 * 1609 * This function is now deprecated and always returns 0 (no limit). See also webkit_web_context_set_web_process_count_limit(). 1610 * 1608 1611 * Returns: the maximum limit of web processes, or 0 if there isn't a limit. 1609 1612 * 1610 1613 * Since: 2.10 1614 * 1615 * Deprecated: 2.26 1611 1616 */ 1612 1617 guint webkit_web_context_get_web_process_count_limit(WebKitWebContext* context) … … 1614 1619 g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), 0); 1615 1620 1616 return context->priv->processCountLimit;1621 return 0; 1617 1622 } 1618 1623 -
trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h
r243285 r249419 68 68 /** 69 69 * WebKitProcessModel: 70 * @WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS: Use a single process to 71 * perform content rendering. The process is shared among all the 72 * #WebKitWebView instances created by the application: if the process 73 * hangs or crashes all the web views in the application will be affected. 74 * This is the default process model, and it should suffice for most cases. 70 * @WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS: Deprecated 2.26. 75 71 * @WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES: Use one process 76 72 * for each #WebKitWebView, while still allowing for some of them to … … 194 190 webkit_web_context_get_cache_model (WebKitWebContext *context); 195 191 196 WEBKIT_ APIvoid192 WEBKIT_DEPRECATED void 197 193 webkit_web_context_set_web_process_count_limit (WebKitWebContext *context, 198 194 guint limit); 199 195 200 WEBKIT_ APIguint196 WEBKIT_DEPRECATED guint 201 197 webkit_web_context_get_web_process_count_limit (WebKitWebContext *context); 202 198 -
trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h
r243285 r249419 68 68 /** 69 69 * WebKitProcessModel: 70 * @WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS: Use a single process to 71 * perform content rendering. The process is shared among all the 72 * #WebKitWebView instances created by the application: if the process 73 * hangs or crashes all the web views in the application will be affected. 74 * This is the default process model, and it should suffice for most cases. 70 * @WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS: Deprecated 2.26. 75 71 * @WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES: Use one process 76 72 * for each #WebKitWebView, while still allowing for some of them to … … 194 190 webkit_web_context_get_cache_model (WebKitWebContext *context); 195 191 196 WEBKIT_ APIvoid192 WEBKIT_DEPRECATED void 197 193 webkit_web_context_set_web_process_count_limit (WebKitWebContext *context, 198 194 guint limit); 199 195 200 WEBKIT_ APIguint196 WEBKIT_DEPRECATED guint 201 197 webkit_web_context_get_web_process_count_limit (WebKitWebContext *context); 202 198 -
trunk/Tools/ChangeLog
r249377 r249419 1 2019-09-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [WPE][GTK] Deprecate nonfunctional process limit APIs 4 https://bugs.webkit.org/show_bug.cgi?id=193749 5 6 Reviewed by Žan Doberšek. 7 8 * MiniBrowser/gtk/main.c: 9 (main): 10 * TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp: 11 (beforeAll): 12 (testWebProcessLimit): Deleted. 13 1 14 2019-09-02 Zan Dobersek <zdobersek@igalia.com> 2 15 -
trunk/Tools/MiniBrowser/gtk/main.c
r249192 r249419 553 553 } 554 554 555 const gchar *singleprocess = g_getenv("MINIBROWSER_SINGLEPROCESS");556 webkit_web_context_set_process_model(webContext, (singleprocess && *singleprocess) ?557 WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS : WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);558 559 555 // Enable the favicon database, by specifying the default directory. 560 556 webkit_web_context_set_favicon_database_directory(webContext, NULL); -
trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp
r239772 r249419 62 62 assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_webViews[index].get())); 63 63 64 m_webViewBusNames[index] = GUniquePtr<char>(g_strdup_printf("org.webkit.gtk.WebExtensionTest%u", Test::s_webExtensionID));65 66 64 webkit_web_view_load_html(m_webViews[index].get(), "<html></html>", nullptr); 67 65 g_signal_connect(m_webViews[index].get(), "load-changed", G_CALLBACK(loadChanged), this); 68 66 g_main_loop_run(m_mainLoop); 67 68 m_webViewBusNames[index] = GUniquePtr<char>(g_strdup_printf("org.webkit.gtk.WebExtensionTest%u", Test::s_webExtensionID)); 69 69 } 70 70 … … 249 249 } 250 250 251 static void testWebProcessLimit(MultiprocessTest* test, gconstpointer)252 {253 g_assert_cmpuint(webkit_web_context_get_web_process_count_limit(test->m_webContext.get()), ==, 0);254 255 webkit_web_context_set_web_process_count_limit(test->m_webContext.get(), 1);256 g_assert_cmpuint(webkit_web_context_get_web_process_count_limit(test->m_webContext.get()), ==, 1);257 258 // Create two web views but there should be only one web process.259 for (unsigned i = 0; i < numViews; i++) {260 test->loadWebViewAndWaitUntilLoaded(i);261 g_assert_true(WEBKIT_IS_WEB_VIEW(test->m_webViews[i].get()));262 }263 264 g_assert_cmpuint(test->m_initializeWebExtensionsSignalCount, ==, 1);265 }266 267 251 void beforeAll() 268 252 { 269 253 // Check that default setting is the one stated in the documentation 270 g_assert_cmpuint(webkit_web_context_get_process_model(webkit_web_context_get_default()), 271 ==, WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS); 272 273 webkit_web_context_set_process_model(webkit_web_context_get_default(), 274 WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); 275 276 // Check that the getter returns the newly-set value 277 g_assert_cmpuint(webkit_web_context_get_process_model(webkit_web_context_get_default()), 278 ==, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); 254 g_assert_cmpuint(webkit_web_context_get_process_model(webkit_web_context_get_default()), ==, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); 279 255 280 256 bus = new WebKitTestBus(); … … 284 260 MultiprocessTest::add("WebKitWebContext", "process-per-web-view", testProcessPerWebView); 285 261 UIClientMultiprocessTest::add("WebKitWebView", "multiprocess-create-ready-close", testMultiprocessWebViewCreateReadyClose); 286 MultiprocessTest::add("WebKitWebContext", "web-process-limit", testWebProcessLimit);287 262 } 288 263
Note: See TracChangeset
for help on using the changeset viewer.