<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[163698] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/163698">163698</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-08 00:25:22 -0800 (Sat, 08 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Make process model names properly meaningful
https://bugs.webkit.org/show_bug.cgi?id=128389

Patch by Adrian Perez de Castro &lt;aperez@igalia.com&gt; on 2014-02-08
Reviewed by Carlos Garcia Campos.

The name WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW
is misleading because there are situations in which web views may
share the same web process even when multi-process mode is enabled;
for example when opening a related view and both interact using JS.

Source/WebKit2:

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_set_process_model):
(webkit_web_context_get_process_model):
Update names of WebKitProcessModel enum values.
* UIProcess/API/gtk/WebKitWebContext.h:
Ditto.

Tools:

* MiniBrowser/gtk/main.c:
(main):
Update usage of WebKitProcessModel enum values.
* TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp:
(beforeAll):
Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebContexth">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsMiniBrowsergtkmainc">trunk/Tools/MiniBrowser/gtk/main.c</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestMultiprocesscpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (163697 => 163698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-02-08 08:24:08 UTC (rev 163697)
+++ trunk/Source/WebKit2/ChangeLog        2014-02-08 08:25:22 UTC (rev 163698)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-02-08  Adrian Perez de Castro  &lt;aperez@igalia.com&gt;
+
+        [GTK] Make process model names properly meaningful
+        https://bugs.webkit.org/show_bug.cgi?id=128389
+
+        Reviewed by Carlos Garcia Campos.
+
+        The name WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW
+        is misleading because there are situations in which web views may
+        share the same web process even when multi-process mode is enabled;
+        for example when opening a related view and both interact using JS.
+
+        * UIProcess/API/gtk/WebKitWebContext.cpp:
+        (webkit_web_context_set_process_model):
+        (webkit_web_context_get_process_model):
+        Update names of WebKitProcessModel enum values.
+        * UIProcess/API/gtk/WebKitWebContext.h:
+        Ditto.
+
</ins><span class="cx"> 2014-02-08  Piotr Grad  &lt;p.grad@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Build break in WebKitSettings
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp (163697 => 163698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp        2014-02-08 08:24:08 UTC (rev 163697)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp        2014-02-08 08:25:22 UTC (rev 163698)
</span><span class="lines">@@ -163,9 +163,6 @@
</span><span class="cx"> 
</span><span class="cx"> static guint signals[LAST_SIGNAL] = { 0, };
</span><span class="cx"> 
</span><del>-COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS, ProcessModelSharedSecondaryProcess);
-COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW, ProcessModelMultipleSecondaryProcesses);
-
</del><span class="cx"> WEBKIT_DEFINE_TYPE(WebKitWebContext, webkit_web_context, G_TYPE_OBJECT)
</span><span class="cx"> 
</span><span class="cx"> static void webkit_web_context_class_init(WebKitWebContextClass* webContextClass)
</span><span class="lines">@@ -898,15 +895,19 @@
</span><span class="cx">  * determine how auxiliary processes are handled. The default setting
</span><span class="cx">  * (%WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS) is suitable for most
</span><span class="cx">  * applications which embed a small amount of WebViews, or are used to
</span><del>- * display documents which are considered safe -- like local files.
</del><ins>+ * display documents which are considered safe — like local files.
</ins><span class="cx">  *
</span><del>- * Applications which may potentially use a large amount of WebViews --for
- * example a multi-tabbed web browser-- may want to use
- * %WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW to use one
- * process per view. Using this model, when a WebView hangs or crashes,
- * the rest of the WebViews in the application will still work normally.
</del><ins>+ * 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.
</ins><span class="cx">  *
</span><del>- * This method &lt;strong&gt;must be called before any other functions&lt;/strong&gt;,
</del><ins>+ * This method **must be called before any other functions**,
</ins><span class="cx">  * as early as possible in your application. Calling it later will make
</span><span class="cx">  * your application crash.
</span><span class="cx">  *
</span><span class="lines">@@ -916,10 +917,24 @@
</span><span class="cx"> {
</span><span class="cx">     g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));
</span><span class="cx"> 
</span><del>-    if (processModel != context-&gt;priv-&gt;context-&gt;processModel()) {
-        context-&gt;priv-&gt;context-&gt;setUsesNetworkProcess(processModel == ProcessModelMultipleSecondaryProcesses);
-        context-&gt;priv-&gt;context-&gt;setProcessModel(static_cast&lt;ProcessModel&gt;(processModel));
</del><ins>+    ProcessModel newProcessModel;
+
+    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();
</ins><span class="cx">     }
</span><ins>+
+    if (newProcessModel == context-&gt;priv-&gt;context-&gt;processModel())
+        return;
+
+    context-&gt;priv-&gt;context-&gt;setUsesNetworkProcess(newProcessModel == ProcessModelMultipleSecondaryProcesses);
+    context-&gt;priv-&gt;context-&gt;setProcessModel(newProcessModel);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -936,7 +951,15 @@
</span><span class="cx"> WebKitProcessModel webkit_web_context_get_process_model(WebKitWebContext* context)
</span><span class="cx"> {
</span><span class="cx">     g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS);
</span><del>-    return static_cast&lt;WebKitProcessModel&gt;(context-&gt;priv-&gt;context-&gt;processModel());
</del><ins>+
+    switch (context-&gt;priv-&gt;context-&gt;processModel()) {
+    case ProcessModelSharedSecondaryProcess:
+        return WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS;
+    case ProcessModelMultipleSecondaryProcesses:
+        return WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES;
+    default:
+        g_assert_not_reached();
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebKitDownload* webkitWebContextGetOrCreateDownload(DownloadProxy* downloadProxy)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h (163697 => 163698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h        2014-02-08 08:24:08 UTC (rev 163697)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h        2014-02-08 08:25:22 UTC (rev 163698)
</span><span class="lines">@@ -69,13 +69,15 @@
</span><span class="cx">  *   #WebKitWebView instances created by the application: if the process
</span><span class="cx">  *   hangs or crashes all the web views in the application will be affected.
</span><span class="cx">  *   This is the default process model, and it should suffice for most cases.
</span><del>- * @WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW: 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.
</del><ins>+ * @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.
</ins><span class="cx">  *
</span><span class="cx">  * Enum values used for determining the #WebKitWebContext process model.
</span><span class="cx">  *
</span><span class="lines">@@ -83,7 +85,7 @@
</span><span class="cx">  */
</span><span class="cx"> typedef enum {
</span><span class="cx">     WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS,
</span><del>-    WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW,
</del><ins>+    WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES,
</ins><span class="cx"> } WebKitProcessModel;
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (163697 => 163698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-02-08 08:24:08 UTC (rev 163697)
+++ trunk/Tools/ChangeLog        2014-02-08 08:25:22 UTC (rev 163698)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-02-08  Adrian Perez de Castro  &lt;aperez@igalia.com&gt;
+
+        [GTK] Make process model names properly meaningful
+        https://bugs.webkit.org/show_bug.cgi?id=128389
+
+        Reviewed by Carlos Garcia Campos.
+
+        The name WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW
+        is misleading because there are situations in which web views may
+        share the same web process even when multi-process mode is enabled;
+        for example when opening a related view and both interact using JS.
+
+        * MiniBrowser/gtk/main.c:
+        (main):
+        Update usage of WebKitProcessModel enum values.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp:
+        (beforeAll):
+        Ditto.
+
</ins><span class="cx"> 2014-02-08  Diego Pino Garcia  &lt;dpino@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] build-webkit script always generate-gtk-doc even if '--disable-gtk-doc' param is passed
</span></span></pre></div>
<a id="trunkToolsMiniBrowsergtkmainc"></a>
<div class="modfile"><h4>Modified: trunk/Tools/MiniBrowser/gtk/main.c (163697 => 163698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/MiniBrowser/gtk/main.c        2014-02-08 08:24:08 UTC (rev 163697)
+++ trunk/Tools/MiniBrowser/gtk/main.c        2014-02-08 08:25:22 UTC (rev 163698)
</span><span class="lines">@@ -244,7 +244,7 @@
</span><span class="cx">     const gchar *multiprocess = g_getenv(&quot;MINIBROWSER_MULTIPROCESS&quot;);
</span><span class="cx">     if (multiprocess &amp;&amp; *multiprocess) {
</span><span class="cx">         webkit_web_context_set_process_model(webkit_web_context_get_default(),
</span><del>-            WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW);
</del><ins>+            WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     GOptionContext *context = g_option_context_new(NULL);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestMultiprocesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp (163697 => 163698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp        2014-02-08 08:24:08 UTC (rev 163697)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp        2014-02-08 08:25:22 UTC (rev 163698)
</span><span class="lines">@@ -122,11 +122,11 @@
</span><span class="cx">         ==, WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS);
</span><span class="cx"> 
</span><span class="cx">     webkit_web_context_set_process_model(webkit_web_context_get_default(),
</span><del>-        WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW);
</del><ins>+        WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
</ins><span class="cx"> 
</span><span class="cx">     // Check that the getter returns the newly-set value
</span><span class="cx">     g_assert_cmpuint(webkit_web_context_get_process_model(webkit_web_context_get_default()),
</span><del>-        ==, WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW);
</del><ins>+        ==, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
</ins><span class="cx"> 
</span><span class="cx">     bus = new WebKitTestBus();
</span><span class="cx">     if (!bus-&gt;run())
</span></span></pre>
</div>
</div>

</body>
</html>