WebKit Bugzilla
Attachment 361057 Details for
Bug 193749
: [WPE][GTK] Deprecate nonfunctional process limit APIs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193749-20190204100655.patch (text/plain), 17.68 KB, created by
Michael Catanzaro
on 2019-02-04 08:06:56 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Michael Catanzaro
Created:
2019-02-04 08:06:56 PST
Size:
17.68 KB
patch
obsolete
>Subversion Revision: 240925 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 9f125cc22a6d892366ad6880335ebfbc70e66e6d..75b1e2e3557cb6b60432e3d91c02f57548478183 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,21 @@ >+2019-02-04 Michael Catanzaro <mcatanzaro@igalia.com> >+ >+ [WPE][GTK] Deprecate nonfunctional process limit APIs >+ https://bugs.webkit.org/show_bug.cgi?id=193749 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Support for these settings has been removed from the WebKit layer, so our API should remove >+ them too. >+ >+ * UIProcess/API/glib/WebKitWebContext.cpp: >+ (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-02-04 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed, avoid -Wswitch warnings introduced in r240880 >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp >index 724c5fbf5e847ced1f30fb08cfd58d8d1f569f0b..49dc7cce3d33a4d60150f932bc6aabf606a1c521 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp >@@ -82,9 +82,8 @@ using namespace WebKit; > * The #WebKitWebContext manages all aspects common to all > * #WebKitWebView<!-- -->s. > * >- * You can define the #WebKitCacheModel and #WebKitProcessModel with >- * webkit_web_context_set_cache_model() and >- * webkit_web_context_set_process_model(), depending on the needs of >+ * You can define the #WebKitCacheModel with >+ * webkit_web_context_set_cache_model(), depending on the needs of > * your application. You can access the #WebKitSecurityManager to specify > * the behaviour of your application regarding security using > * webkit_web_context_get_security_manager(). >@@ -178,8 +177,6 @@ struct _WebKitWebContextPrivate { > > CString faviconDatabaseDirectory; > WebKitTLSErrorsPolicy tlsErrorsPolicy; >- WebKitProcessModel processModel; >- unsigned processCountLimit; > > HashMap<uint64_t, WebKitWebView*> webViews; > unsigned ephemeralPageCount; >@@ -1486,87 +1483,73 @@ void webkit_web_context_allow_tls_certificate_for_host(WebKitWebContext* context > * @context: the #WebKitWebContext > * @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. >- * >- * 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 >- * 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 >- * hangs or crashes, only the WebViews using it stop working, while >- * the rest of the WebViews in the application will still function >- * normally. >+ * This function does nothing. > * >- * 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 used to allow specifying whether web views created in >+ * @context should share the same web content rendering process or use >+ * separate rendering processes. Sharing the same process is no longer >+ * allowed. > * > * Since: 2.4 >+ * >+ * Deprecated: 2.26 > */ >-void webkit_web_context_set_process_model(WebKitWebContext* context, WebKitProcessModel processModel) >+void webkit_web_context_set_process_model(WebKitWebContext* context, WebKitProcessModel) > { > g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context)); >- >- if (processModel == context->priv->processModel) >- return; >- >- context->priv->processModel = processModel; > } > > /** > * webkit_web_context_get_process_model: > * @context: the #WebKitWebContext > * >- * Returns the current process model. For more information about this value >- * see webkit_web_context_set_process_model(). >+ * Returns the current process model, which is always >+ * @WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES. For details, see >+ * webkit_web_context_set_process_model(). > * >- * Returns: the current #WebKitProcessModel >+ * Returns: @WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES > * > * Since: 2.4 >+ * >+ * Deprecated: 2.26 > */ > 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; >+ return WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES; > } > > /** > * webkit_web_context_set_web_process_count_limit: > * @context: the #WebKitWebContext >- * @limit: the maximum number of web processes >+ * @limit: ignored > * >- * 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 function does nothing. > * >- * 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 used to set the maximum number of web processes that >+ * could be created at the same time for the @context, but it is no >+ * longer safe to set such limits as process swapping is required to >+ * mitigate speculative execution vulnerabilities. > * > * Since: 2.10 >+ * >+ * Deprecated: 2.26 > */ >-void webkit_web_context_set_web_process_count_limit(WebKitWebContext* context, guint limit) >+void webkit_web_context_set_web_process_count_limit(WebKitWebContext* context, guint) > { > g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context)); >- >- if (context->priv->processCountLimit == limit) >- return; >- >- context->priv->processCountLimit = limit; > } > > /** > * webkit_web_context_get_web_process_count_limit: > * @context: the #WebKitWebContext > * >- * Gets the maximum number of web processes that can be created at the same time for the @context. >+ * This function used to return the maximum number of web processes set >+ * with webkit_web_context_set_web_process_count_limit(). It is no >+ * longer possible to set such a limit, so now it always returns 0. > * >- * Returns: the maximum limit of web processes, or 0 if there isn't a limit. >+ * Returns: 0 > * > * Since: 2.10 > */ >@@ -1574,7 +1557,7 @@ 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) >diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h b/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h >index 81351af3c51080eb73c24505c6af822f6220c9a2..0cd4483f16eb007e511577c10217a7a270117e02 100644 >--- a/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h >+++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h >@@ -67,19 +67,11 @@ typedef enum { > /** > * 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_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 >- * of this process model is that the rendering process for a web view >- * can crash while the rest of the views keep working normally. This >- * process model is indicated for applications which may use a number >- * of web views and the content of in each must not interfere with the >- * rest â for example a full-fledged web browser with support for >- * multiple tabs. >+ * perform content rendering. This is no longer allowed since 2.26. >+ * @WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES: Use one or more >+ * processes for each #WebKitWebView, while still allowing for some >+ * of them to share a process in certain situations. This process >+ * model is now required since 2.26. > * > * Enum values used for determining the #WebKitWebContext process model. > * >@@ -192,11 +184,11 @@ webkit_web_context_set_cache_model (WebKitWebContext > 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 >@@ -305,11 +297,11 @@ webkit_web_context_allow_tls_certificate_for_host (WebKitWebContext > GTlsCertificate *certificate, > const gchar *host); > >-WEBKIT_API void >+WEBKIT_DEPRECATED void > webkit_web_context_set_process_model (WebKitWebContext *context, > WebKitProcessModel process_model); > >-WEBKIT_API WebKitProcessModel >+WEBKIT_DEPRECATED WebKitProcessModel > webkit_web_context_get_process_model (WebKitWebContext *context); > > WEBKIT_API void >diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h b/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h >index 081cd11a342a9f611a4f4198cec293294c2a2701..674af64424158f4a28b521b0656e426c32fdf377 100644 >--- a/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h >+++ b/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h >@@ -67,19 +67,11 @@ typedef enum { > /** > * 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_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 >- * of this process model is that the rendering process for a web view >- * can crash while the rest of the views keep working normally. This >- * process model is indicated for applications which may use a number >- * of web views and the content of in each must not interfere with the >- * rest â for example a full-fledged web browser with support for >- * multiple tabs. >+ * perform content rendering. This is no longer allowed since 2.26. >+ * @WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES: Use one or more >+ * processes for each #WebKitWebView, while still allowing for some >+ * of them to share a process in certain situations. This process >+ * model is now required since 2.26. > * > * Enum values used for determining the #WebKitWebContext process model. > * >@@ -192,11 +184,11 @@ webkit_web_context_set_cache_model (WebKitWebContext > 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 >@@ -301,11 +293,11 @@ webkit_web_context_allow_tls_certificate_for_host (WebKitWebContext > GTlsCertificate *certificate, > const gchar *host); > >-WEBKIT_API void >+WEBKIT_DEPRECATED void > webkit_web_context_set_process_model (WebKitWebContext *context, > WebKitProcessModel process_model); > >-WEBKIT_API WebKitProcessModel >+WEBKIT_DEPRECATED WebKitProcessModel > webkit_web_context_get_process_model (WebKitWebContext *context); > > WEBKIT_API void >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 1c2a54e926a8d87f796d90989a822af00b3b34df..366c84677c43c34c65a1d91583f894797ca65fa1 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,16 @@ >+2019-02-04 Michael Catanzaro <mcatanzaro@igalia.com> >+ >+ [WPE][GTK] Deprecate nonfunctional process limit APIs >+ https://bugs.webkit.org/show_bug.cgi?id=193749 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * MiniBrowser/gtk/main.c: >+ (main): >+ * TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp: >+ (testWebProcessLimit): >+ (beforeAll): >+ > 2019-02-03 Fujii Hironori <Hironori.Fujii@sony.com> > > [Win] WebKitTestRunners is failing to create the IndexedDB directory. >diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c >index afbe555ea5283bbb7c8743f4a3767f6e5cd1ee41..e2ac8bb740a7eb986d7f911961d760e9c6f14ab7 100644 >--- a/Tools/MiniBrowser/gtk/main.c >+++ b/Tools/MiniBrowser/gtk/main.c >@@ -526,10 +526,6 @@ int main(int argc, char *argv[]) > 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); > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp >index 9b5e6b62d10bc8fbd1ba8b91b19542091bbe296e..2f2a2e399f044cbd64724280a3300526e73b4468 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp >@@ -37,7 +37,6 @@ public: > , m_webViewBusNames(numViews) > , m_webViews(numViews) > { >- webkit_web_context_set_process_model(m_webContext.get(), WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); > } > > void initializeWebExtensions() override >@@ -169,7 +168,6 @@ public: > : m_mainLoop(g_main_loop_new(nullptr, TRUE)) > , m_initializeWebExtensionsSignalCount(0) > { >- webkit_web_context_set_process_model(m_webContext.get(), WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); > m_webView = WEBKIT_WEB_VIEW(Test::createWebView(m_webContext.get())); > #if PLATFORM(GTK) > g_object_ref_sink(m_webView); >@@ -250,32 +248,30 @@ static void testMultiprocessWebViewCreateReadyClose(UIClientMultiprocessTest* te > > static void testWebProcessLimit(MultiprocessTest* test, gconstpointer) > { >+#pragma GCC diagnostic push >+#pragma GCC diagnostic ignored "-Wdeprecated-declarations" > g_assert_cmpuint(webkit_web_context_get_web_process_count_limit(test->m_webContext.get()), ==, 0); > >+ // Setting a process count limit is no longer allowed. > 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); >+ g_assert_cmpuint(webkit_web_context_get_web_process_count_limit(test->m_webContext.get()), ==, 0); >+#pragma GCC diagnostic pop > } > > void beforeAll() > { >+#pragma GCC diagnostic push >+#pragma GCC diagnostic ignored "-Wdeprecated-declarations" > // 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); >+ ==, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); > >+ // Verify that changing the process model is no longer allowed. > 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 >+ 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); >+#pragma GCC diagnostic pop > > bus = new WebKitTestBus(); > if (!bus->run())
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193749
:
360313
|
361057
|
377875
|
377876