WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-125463-20140122005727.patch (text/plain), 21.61 KB, created by
Adrian Perez
on 2014-01-21 14:56:57 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Adrian Perez
Created:
2014-01-21 14:56:57 PST
Size:
21.61 KB
patch
obsolete
>Subversion Revision: 162446 >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 570bdec570daa366886820d3a8bed6683f976c24..43525af216ade674edb7d640c4654dc7685b7b1b 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,5 +1,29 @@ > 2014-01-21 Adrian Perez de Castro <aperez@igalia.com> > >+ [GTK] Add API to allow setting the process model in WebKitWebContext >+ https://bugs.webkit.org/show_bug.cgi?id=125463 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implements accessors in WebKitWebContext for the process model. >+ The default behavior is unchanged, and a single web process is >+ used. Setting WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES >+ as the process model will make use of a network process and >+ multiple web processes. Setting the process model must be done >+ as early as possible, before the very first web process is >+ spawned. >+ >+ * UIProcess/API/gtk/WebKitWebContext.cpp: >+ Add accessors in the API to get/set the process model. >+ (webkit_web_context_set_process_model): >+ (webkit_web_context_get_process_model): >+ * UIProcess/API/gtk/WebKitWebContext.h: >+ Define the WebKitProcessModel enum. >+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: >+ Add new public API bits to the documentation. >+ >+2014-01-21 Adrian Perez de Castro <aperez@igalia.com> >+ > [GTK] Allow passing extra data to web extensions > https://bugs.webkit.org/show_bug.cgi?id=125990 > >diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp >index d56f5e543e2343cd154f93a108e948aaff82a90e..835c9d5be0e296d3cc3da4dc91755bdc16efb639 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp >+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp >@@ -64,8 +64,9 @@ using namespace WebKit; > * The #WebKitWebContext manages all aspects common to all > * #WebKitWebView<!-- -->s. > * >- * You can define the #WebKitCacheModel with >- * webkit_web_context_set_cache_model(), depending on the needs of >+ * 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 > * your application. You can access the #WebKitCookieManager or the > * #WebKitSecurityManager to specify the behaviour of your application > * regarding cookies and security, using >@@ -889,6 +890,78 @@ void webkit_web_context_allow_tls_certificate_for_host(WebKitWebContext* context > context->priv->context->allowSpecificHTTPSCertificateForHost(webCertificateInfo.get(), String::fromUTF8(host)); > } > >+/** >+ * webkit_web_context_set_process_model: >+ * @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 is >+ * %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 is 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 to use one auxiliary >+ * process per view. Using this model, when a WebView in a tab hangs or >+ * crashes, the rest of the tabs in the browser will still work normally. >+ * >+ * This method <strong>must be called before any other functions</string>, >+ * as early as possible in your application. Calling it later will make >+ * your application crash. >+ * >+ * Since: 2.4 >+ */ >+void webkit_web_context_set_process_model(WebKitWebContext* context, WebKitProcessModel processModel) >+{ >+ ProcessModel newProcessModel; >+ >+ g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context)); >+ >+ switch (processModel) { >+ case WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS: >+ newProcessModel = ProcessModelSharedSecondaryProcess; >+ break; >+ case WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES: >+ newProcessModel = ProcessModelMultipleSecondaryProcesses; >+ break; >+ default: >+ g_assert_not_reached(); >+ } >+ >+ if (newProcessModel != context->priv->context->processModel()) { >+ context->priv->context->setUsesNetworkProcess(newProcessModel == ProcessModelMultipleSecondaryProcesses); >+ context->priv->context->setProcessModel(newProcessModel); >+ } >+} >+ >+/** >+ * webkit_web_context_get_process_model: >+ * @context: the #WebKitWebContext >+ * >+ * Returns the current process model. For more information about this value >+ * check the documentation of the function >+ * webkit_web_context_set_process_model(). >+ * >+ * Returns: the current #WebKitProcessModel >+ */ >+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); >+ >+ switch (context->priv->context->processModel()) { >+ case ProcessModelSharedSecondaryProcess: >+ return WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS; >+ case ProcessModelMultipleSecondaryProcesses: >+ return WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES; >+ default: >+ g_assert_not_reached(); >+ } >+ >+ return WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS; >+} >+ > WebKitDownload* webkitWebContextGetOrCreateDownload(DownloadProxy* downloadProxy) > { > GRefPtr<WebKitDownload> download = downloadsMap().get(downloadProxy); >diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h >index 1e3b9b588d65a85499a86bb716cb67be23d922aa..852de3a41ec1b6105f6eaefe2708f2058fe49708 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h >+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h >@@ -63,6 +63,27 @@ typedef enum { > } WebKitCacheModel; > > /** >+ * 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 secondary >+ * 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. 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. >+ * >+ * Enum values used for determining the #WebKitWebContext process model. >+ */ >+typedef enum { >+ WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS, >+ WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES >+} WebKitProcessModel; >+ >+/** > * WebKitTLSErrorsPolicy: > * @WEBKIT_TLS_ERRORS_POLICY_IGNORE: Ignore TLS errors. > * @WEBKIT_TLS_ERRORS_POLICY_FAIL: TLS errors will emit >@@ -213,6 +234,13 @@ webkit_web_context_allow_tls_certificate_for_host (WebKitWebContext > WebKitCertificateInfo *info, > const gchar *host); > >+WEBKIT_API void >+webkit_web_context_set_process_model (WebKitWebContext *context, >+ WebKitProcessModel process_model); >+ >+WEBKIT_API WebKitProcessModel >+webkit_web_context_get_process_model (WebKitWebContext *context); >+ > G_END_DECLS > > #endif >diff --git a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt >index 1c13c6c073a75d197d70562c0297921f7b6382f4..94214966d5c2656ff96c638b8498b054cd2e7cdc 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt >+++ b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt >@@ -24,6 +24,7 @@ WEBKIT_OBSOLETE_API > <TITLE>WebKitWebContext</TITLE> > WebKitWebContext > WebKitCacheModel >+WebKitProcessModel > WebKitTLSErrorsPolicy > webkit_web_context_get_default > webkit_web_context_get_cache_model >@@ -50,6 +51,8 @@ webkit_web_context_set_web_extensions_initialization_user_data > webkit_web_context_prefetch_dns > webkit_web_context_set_disk_cache_directory > webkit_web_context_allow_tls_certificate_for_host >+webkit_web_context_get_process_model >+webkit_web_context_set_process_model > > <SUBSECTION URI Scheme> > WebKitURISchemeRequestCallback >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 913e74fdb0c3debcb0e09928261874198fbe736d..1a8af88b893e25e70a27305de19703657e3f801f 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,41 @@ >+2014-01-21 Adrian Perez de Castro <aperez@igalia.com> >+ >+ [GTK] Add API to allow setting the process model in WebKitWebContext >+ https://bugs.webkit.org/show_bug.cgi?id=125463 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implements accessors in WebKitWebContext for the process model. >+ The default behavior is unchanged, and a single web process is >+ used. Setting WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES >+ as the process model will make use of a network process and >+ multiple web processes. Setting the process model must be done >+ as early as possible, before the very first web process is >+ spawned. >+ >+ * MiniBrowser/gtk/main.c: >+ (main): >+ Enable multiple process mode if the MINIBROWSER_MULTIPROCESS >+ environment variable is defined and not empty. >+ * TestWebKitAPI/GNUmakefile.am: >+ Add new TestMultiprocess test case. >+ * TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt: >+ Add new TestMultiprocess test case. >+ * TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp: Added. >+ (loadChanged): >+ (testMultipleSecondaryProcesses): >+ (initializeWebExtensions): >+ (beforeAll): >+ (afterAll): >+ * TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp: >+ (methodCallCallback): >+ Implement the GetProcessIdentifier D-Bus method. >+ (makeBusName): >+ Choose a different bus name when the web extension is used >+ from TestMultiprocess. >+ (webkit_web_extension_initialize_with_user_data): >+ Use makeBusName() to choose the bus name. >+ > 2014-01-21 Peter Molnar <pmolnar.u-szeged@partner.samsung.com> > > run-jsc-stress-tests should accept --child-processes option and WEBKIT_TEST_CHILD_PROCESSES env.var >diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c >index 5049cf21f0e5d75c5bd9af4572b9109e84dd4e40..e09122edbde78d6c1c1ca3d5e1c9ce10a1aa5187 100644 >--- a/Tools/MiniBrowser/gtk/main.c >+++ b/Tools/MiniBrowser/gtk/main.c >@@ -241,6 +241,12 @@ int main(int argc, char *argv[]) > { > gtk_init(&argc, &argv); > >+ const gchar *minibrowser = g_getenv("MINIBROWSER_MULTIPROCESS"); >+ if (minibrowser && *minibrowser) { >+ webkit_web_context_set_process_model(webkit_web_context_get_default(), >+ WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); >+ } >+ > GOptionContext *context = g_option_context_new(NULL); > g_option_context_add_main_entries(context, commandLineOptions, 0); > g_option_context_add_group(context, gtk_get_option_group(TRUE)); >diff --git a/Tools/TestWebKitAPI/GNUmakefile.am b/Tools/TestWebKitAPI/GNUmakefile.am >index 4fbd391269ae8d80466722f29934f6afc41eac7c..6000d2562aa22a8399789760267b46ad6c6ccacb 100644 >--- a/Tools/TestWebKitAPI/GNUmakefile.am >+++ b/Tools/TestWebKitAPI/GNUmakefile.am >@@ -161,6 +161,7 @@ noinst_PROGRAMS += \ > Programs/TestWebKitAPI/WebKit2Gtk/TestInspector \ > Programs/TestWebKitAPI/WebKit2Gtk/TestInspectorServer \ > Programs/TestWebKitAPI/WebKit2Gtk/TestLoaderClient \ >+ Programs/TestWebKitAPI/WebKit2Gtk/TestMultiprocess \ > Programs/TestWebKitAPI/WebKit2Gtk/TestPrinting \ > Programs/TestWebKitAPI/WebKit2Gtk/TestResources \ > Programs/TestWebKitAPI/WebKit2Gtk/TestSSL \ >@@ -766,6 +767,12 @@ Programs_TestWebKitAPI_WebKit2Gtk_TestLoaderClient_CPPFLAGS = $(webkit2gtk_tests > Programs_TestWebKitAPI_WebKit2Gtk_TestLoaderClient_LDADD = $(webkit2gtk_tests_ldadd) > Programs_TestWebKitAPI_WebKit2Gtk_TestLoaderClient_LDFLAGS = $(webkit2gtk_tests_ldflags) > >+Programs_TestWebKitAPI_WebKit2Gtk_TestMultiprocess_SOURCES = \ >+ Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp >+Programs_TestWebKitAPI_WebKit2Gtk_TestMultiprocess_CPPFLAGS = $(webkit2gtk_tests_cppflags) >+Programs_TestWebKitAPI_WebKit2Gtk_TestMultiprocess_LDADD = $(webkit2gtk_tests_ldadd) >+Programs_TestWebKitAPI_WebKit2Gtk_TestMultiprocess_LDFLAGS = $(webkit2gtk_tests_ldflags) >+ > Programs_TestWebKitAPI_WebKit2Gtk_TestWebKitSettings_SOURCES = \ > Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp > Programs_TestWebKitAPI_WebKit2Gtk_TestWebKitSettings_CPPFLAGS = $(webkit2gtk_tests_cppflags) >diff --git a/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt b/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt >index b883cf1e6d492e2d3d83e54a99e9e2b71fea0c1a..940ed733ac449375471a04bac247f7041b84f7df 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt >+++ b/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt >@@ -92,6 +92,7 @@ ADD_WK2_TEST(TestFrame TestFrame.cpp) > ADD_WK2_TEST(TestInspector TestInspector.cpp) > ADD_WK2_TEST(TestInspectorServer TestInspectorServer.cpp) > ADD_WK2_TEST(TestLoaderClient TestLoaderClient.cpp) >+ADD_WK2_TEST(TestMultiprocess TestMultiprocess.cpp) > ADD_WK2_TEST(TestPrinting TestPrinting.cpp) > ADD_WK2_TEST(TestSSL TestSSL.cpp) > ADD_WK2_TEST(TestWebExtensions TestWebExtensions.cpp) >diff --git a/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp b/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..31d1a82eb464278e3a1dbb9de0b2f60532384519 >--- /dev/null >+++ b/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp >@@ -0,0 +1,148 @@ >+/* >+ * Copyright (C) 2014 Igalia S.L. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Lesser General Public >+ * License as published by the Free Software Foundation; either >+ * version 2,1 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+ >+#include "TestMain.h" >+#include "WebKitTestBus.h" >+#include <webkit2/webkit2.h> >+ >+class MultiprocessTest; >+static void loadChanged(WebKitWebView*, WebKitLoadEvent, MultiprocessTest*); >+ >+static guint32 nextInitializationId = 1; >+static guint initializeWebExtensionsSignalCount = 0; >+static WebKitTestBus* bus = nullptr; >+ >+class MultiprocessTest: public Test { >+private: >+ static const guint NUM_VIEWS = 2; >+ >+public: >+ MAKE_GLIB_TEST_FIXTURE(MultiprocessTest); >+ >+ MultiprocessTest() >+ : m_mainLoop(g_main_loop_new(0, TRUE)) >+ { >+ for (guint i = 0; i < NUM_VIEWS; i++) { >+ m_webView[i] = nullptr; >+ m_webViewId[i] = 0; >+ } >+ } >+ >+ ~MultiprocessTest() >+ { >+ for (guint i = 0; i < NUM_VIEWS; i++) >+ g_object_unref(m_webView[i]); >+ g_main_loop_unref(m_mainLoop); >+ } >+ >+ void setupWebView(guint index) >+ { >+ g_assert(index < NUM_VIEWS); >+ m_webViewId[index] = nextInitializationId; >+ m_webView[index] = WEBKIT_WEB_VIEW(g_object_ref_sink(webkit_web_view_new())); >+ webkit_web_view_load_html(m_webView[index], "<html></html>", nullptr); >+ g_signal_connect(m_webView[index], "load-changed", G_CALLBACK(loadChanged), this); >+ g_main_loop_run(m_mainLoop); >+ } >+ >+ guint webProcessPid(guint index) >+ { >+ g_assert(index < NUM_VIEWS); >+ g_assert(m_webViewId[index]); >+ g_assert(m_webView[index]); >+ >+ GOwnPtr<gchar> busName(g_strdup_printf("org.webkit.gtk.WebExtensionTest%u", m_webViewId[index])); >+ GRefPtr<GDBusProxy> proxy = adoptGRef(bus->createProxy(busName.get(), >+ "/org/webkit/gtk/WebExtensionTest", "org.webkit.gtk.WebExtensionTest", m_mainLoop)); >+ >+ GRefPtr<GVariant> result = adoptGRef(g_dbus_proxy_call_sync( >+ proxy.get(), >+ "GetProcessIdentifier", >+ nullptr, >+ G_DBUS_CALL_FLAGS_NONE, >+ -1, 0, 0)); >+ g_assert(result); >+ >+ guint32 identifier = 0; >+ g_variant_get(result.get(), "(u)", &identifier); >+ return identifier; >+ } >+ >+ GMainLoop* m_mainLoop; >+ guint m_webViewId[2]; >+ WebKitWebView* m_webView[2]; >+}; >+ >+ >+static void loadChanged(WebKitWebView* webView, WebKitLoadEvent loadEvent, MultiprocessTest* test) >+{ >+ if (loadEvent != WEBKIT_LOAD_FINISHED) >+ return; >+ g_signal_handlers_disconnect_by_func(webView, reinterpret_cast<void*>(loadChanged), test); >+ g_main_loop_quit(test->m_mainLoop); >+} >+ >+ >+static void testMultipleSecondaryProcesses(MultiprocessTest* test, gconstpointer) >+{ >+ // Create two web views. As we are in multiprocess mode, there must be >+ // two web processes, running an instance of the web extension each. >+ // The initialize-web-extensions must have been called twice, and the >+ // identifiers generated for them must be different (and their reported >+ // process identifiers). >+ >+ test->setupWebView(0); >+ test->setupWebView(1); >+ >+ g_assert_cmpuint(initializeWebExtensionsSignalCount, ==, 2); >+ g_assert_cmpuint(test->m_webViewId[0], !=, test->m_webViewId[1]); >+ g_assert_cmpuint(test->webProcessPid(0), !=, test->webProcessPid(1)); >+} >+ >+static void initializeWebExtensions(WebKitWebContext* context, gpointer) >+{ >+ initializeWebExtensionsSignalCount++; >+ webkit_web_context_set_web_extensions_directory(context, WEBKIT_TEST_WEB_EXTENSIONS_DIR); >+ webkit_web_context_set_web_extensions_initialization_user_data(context, >+ g_variant_new_uint32(nextInitializationId++)); >+} >+ >+void beforeAll() >+{ >+ g_signal_connect(webkit_web_context_get_default(), >+ "initialize-web-extensions", G_CALLBACK(initializeWebExtensions), nullptr); >+ >+ webkit_web_context_set_process_model(webkit_web_context_get_default(), >+ WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); >+ >+ bus = new WebKitTestBus(); >+ if (!bus->run()) >+ return; >+ >+ MultiprocessTest::add("WebKitWebContext", "multiple-secondary-processes", testMultipleSecondaryProcesses); >+} >+ >+void afterAll() >+{ >+ delete bus; >+ g_signal_handlers_disconnect_by_func(webkit_web_context_get_default(), >+ reinterpret_cast<void*>(initializeWebExtensions), nullptr); >+} >diff --git a/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp b/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp >index e8a2b9f6534ac7e31fd6931d75e833bff8f34be9..40e29690d0945ae2674b0e50662f4ed79c8a7dba 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp >@@ -48,6 +48,9 @@ static const char introspectionXML[] = > " <method name='GetInitializationUserData'>" > " <arg type='s' name='userData' direction='out'/>" > " </method>" >+ " <method name='GetProcessIdentifier'>" >+ " <arg type='u' name='identifier' direction='out'/>" >+ " </method>" > " <signal name='DocumentLoaded'/>" > " <signal name='URIChanged'>" > " <arg type='s' name='uri' direction='out'/>" >@@ -223,6 +226,9 @@ static void methodCallCallback(GDBusConnection* connection, const char* sender, > g_assert(g_variant_is_of_type(initializationUserData.get(), G_VARIANT_TYPE_STRING)); > g_dbus_method_invocation_return_value(invocation, g_variant_new("(s)", > g_variant_get_string(initializationUserData.get(), nullptr))); >+ } else if (!g_strcmp0(methodName, "GetProcessIdentifier")) { >+ g_dbus_method_invocation_return_value(invocation, >+ g_variant_new("(u)", static_cast<guint32>(getpid()))); > } > } > >@@ -262,6 +268,18 @@ static void busAcquiredCallback(GDBusConnection* connection, const char* name, g > } > } > >+static gchar* makeBusName(GVariant* userData) >+{ >+ // When the web extension is used by TestMultiprocess, an uint32 >+ // identifier is passed as user data. It uniquely identifies >+ // the web process, and the UI side expects it added as suffix to >+ // the bus name. >+ if (userData && g_variant_is_of_type(userData, G_VARIANT_TYPE_UINT32)) >+ return g_strdup_printf("org.webkit.gtk.WebExtensionTest%u", g_variant_get_uint32(userData)); >+ >+ return g_strdup("org.webkit.gtk.WebExtensionTest"); >+} >+ > extern "C" void webkit_web_extension_initialize_with_user_data(WebKitWebExtension* extension, GVariant* userData) > { > initializationUserData = userData; >@@ -269,9 +287,10 @@ extern "C" void webkit_web_extension_initialize_with_user_data(WebKitWebExtensio > g_signal_connect(extension, "page-created", G_CALLBACK(pageCreatedCallback), extension); > g_signal_connect(webkit_script_world_get_default(), "window-object-cleared", G_CALLBACK(windowObjectCleared), 0); > >+ GOwnPtr<gchar> busName(makeBusName(userData)); > g_bus_own_name( > G_BUS_TYPE_SESSION, >- "org.webkit.gtk.WebExtensionTest", >+ busName.get(), > G_BUS_NAME_OWNER_FLAGS_NONE, > busAcquiredCallback, > 0, 0,
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 125463
:
218785
|
218982
|
218989
|
221792
|
221848
|
222273
|
222275
|
222323
|
222421