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-20131209210255.patch (text/plain), 7.81 KB, created by
Adrian Perez
on 2013-12-09 12:01:52 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Adrian Perez
Created:
2013-12-09 12:01:52 PST
Size:
7.81 KB
patch
obsolete
>Subversion Revision: 160310 >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 5e8ba24ebe2c26489b7181c6386b858d60eab268..c385b7693a18bc19083d030a7bde7d7dd3aa4f13 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,16 @@ >+2013-12-09 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!). >+ >+ * UIProcess/API/gtk/WebKitWebContext.cpp: >+ (webkit_web_context_set_process_model): >+ (webkit_web_context_get_process_model): >+ * UIProcess/API/gtk/WebKitWebContext.h: >+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: >+ > 2013-12-08 Brian Holt <brian.holt@samsung.com> > > [WK2] Guard Mac specific network process code with PLATFORM(MAC) >diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp >index be10b8e9432c51c6f6f6c2601714ace222b9d692..aea76b985bd01c0fe724bbcc53d6f9e06260fdeb 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp >+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp >@@ -61,8 +61,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 >@@ -829,6 +830,76 @@ 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 must be called before loading anything in this context, >+ * a warning will be issued and the process model will <em>not</em> be >+ * set. >+ * >+ * Since: 2.6 >+ */ >+void webkit_web_context_set_process_model(WebKitWebContext* context, WebKitProcessModel process_model) >+{ >+ ProcessModel processModel; >+ >+ g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context)); >+ >+ switch (process_model) { >+ case WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS: >+ processModel = ProcessModelSharedSecondaryProcess; >+ break; >+ case WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES: >+ processModel = ProcessModelMultipleSecondaryProcesses; >+ break; >+ default: >+ g_assert_not_reached(); >+ } >+ >+ if (processModel != context->priv->context->processModel()) >+ context->priv->context->setProcessModel(processModel); >+} >+ >+/** >+ * 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 9e7bc14476db0223a78bcdf738c2f60b90653d7e..9712d53913d9438edcb0a90d85b11cb97914e693 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 >@@ -208,6 +229,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 e8c0e5f306f12341a374bf16a7f168c248b3ea97..a18a111e7a0272c9dcddbe9f3c95032303fb12fd 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 >@@ -49,6 +50,8 @@ webkit_web_context_set_web_extensions_directory > 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
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