<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>79499</bug_id>
          
          <creation_ts>2012-02-24 09:15:55 -0800</creation_ts>
          <short_desc>[GTK] Add support for nested event loops in RunLoop</short_desc>
          <delta_ts>2012-02-28 15:45:13 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>79496</dependson>
          <blocked>79500</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Mario Sanchez Prada">mario</reporter>
          <assigned_to name="Mario Sanchez Prada">mario</assigned_to>
          <cc>cgarcia</cc>
    
    <cc>mrobinson</cc>
    
    <cc>pnormand</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>564368</commentid>
    <comment_count>0</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2012-02-24 09:15:55 -0800</bug_when>
    <thetext>This is something needed for properly implementing modal dialogs in WebKit2 at least, and something that other ports (e.g. Qt, Mac) already have, so it would be a good addition.

Actually, it would be more than just &quot;a good addition&quot; but something needed if we want to implement modal dialogs in WebKit2GTK+, since I have observed (while working in the patch for modal dialogs in WK2GTK) that it would be very hard (impossible?) to implement proper unit tests for such a patch since the WebProcess would die right after closing the modal dialog, since WebCore would quit the only event loop once the dialog was closed, which would result in the WebProcess being terminated, causing great trouble and pain in the form of the unit tests hanging after that.

So, a patch would be nice here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>564375</commentid>
    <comment_count>1</comment_count>
      <attachid>128747</attachid>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2012-02-24 09:21:02 -0800</bug_when>
    <thetext>Created attachment 128747
Patch Proposal

This patch mimics the implementation for the Qt port, and works pretty nice with the patch I already have in my local machine for supporting modal dialogs in WebKit2GTK+ (that will serve as the test for this, actually).

I will be reporting here the bug for the modal dialogs in WK2GTK as soon as I filed it (in a few minutes)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>564376</commentid>
    <comment_count>2</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2012-02-24 09:22:08 -0800</bug_when>
    <thetext>This patch is written assuming we have support for GMainLoop in GRefPtr, so that&apos;s why I&apos;m setting it as depending on bug 79496</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>564400</commentid>
    <comment_count>3</comment_count>
      <attachid>128747</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-02-24 09:53:37 -0800</bug_when>
    <thetext>Comment on attachment 128747
Patch Proposal

View in context: https://bugs.webkit.org/attachment.cgi?id=128747&amp;action=review

One thing that worries me about this patch is that RunLoop::mainLoop will return the wrong GMainLoop when you are in an interior loop. Perhapsm_runLoopMain should be replaced with a stack of loops?

&gt; Source/WebCore/platform/gtk/RunLoopGtk.cpp:50
&gt; +static GRefPtr&lt;GMainLoop&gt; currentEventLoop;

I think this should be a member of RunLoop. Isn&apos;t it important that this can be used across different threads? You should probably call this currentMainLoop to match the type.

&gt; Source/WebCore/platform/gtk/RunLoopGtk.cpp:55
&gt; +    static bool mainEventLoopIsRunning = false;
&gt; +    if (!mainEventLoopIsRunning) {

mainEventLoopIsRunning can be replaced with a call to g_main_loop_is_running.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>565561</commentid>
    <comment_count>4</comment_count>
      <attachid>129009</attachid>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2012-02-27 04:05:28 -0800</bug_when>
    <thetext>Created attachment 129009
Patch Proposal

(In reply to comment #3)
&gt; (From update of attachment 128747 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=128747&amp;action=review
&gt; 
&gt; One thing that worries me about this patch is that RunLoop::mainLoop will return the wrong GMainLoop when you are in an interior loop. Perhapsm_runLoopMain should be replaced with a stack of loops?

As I said in a previous comment, I just took Qt&apos;s implementation as an example and translated it to Gtk+. Still, I agree with you there might be issues with this approach and so the idea of having a stack of loops sounds good to me too, so here it&apos;s a new patch implementing that approach.

Also, I renamed RunLoop::mainLoop() to RunLoop::rootMainLoop() to make clear that it will return always the initial main loop (the one created on object construction), which is what we need to make sure it&apos;s running before attempting to create a new and nested loop.

&gt; &gt; Source/WebCore/platform/gtk/RunLoopGtk.cpp:50
&gt; &gt; +static GRefPtr&lt;GMainLoop&gt; currentEventLoop;
&gt; 
&gt; I think this should be a member of RunLoop. Isn&apos;t it important that this can be used across different threads? You should probably call this currentMainLoop to match the type.

I just removed this variable now that I hold a Vector of main loops per instance of the RunLoop class. We could add a new RunLoop::currentMainLoop() to get the last one in the stack, but the truth is that I don&apos;t see it necessary at all (see the patch).

&gt; &gt; Source/WebCore/platform/gtk/RunLoopGtk.cpp:55
&gt; &gt; +    static bool mainEventLoopIsRunning = false;
&gt; &gt; +    if (!mainEventLoopIsRunning) {
&gt; 
&gt; mainEventLoopIsRunning can be replaced with a call to g_main_loop_is_running.

Very true. Fixed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>565684</commentid>
    <comment_count>5</comment_count>
      <attachid>129009</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-02-27 08:49:20 -0800</bug_when>
    <thetext>Comment on attachment 129009
Patch Proposal

View in context: https://bugs.webkit.org/attachment.cgi?id=129009&amp;action=review

With a one small fix and a rename, this looks good to me.

&gt; Source/WebCore/platform/gtk/RunLoopGtk.cpp:54
&gt; +    for (size_t i = 0; i &lt; m_runLoopMainLoops.size(); ++i) {
&gt; +        if (!g_main_loop_is_running(m_runLoopMainLoops[i].get()))
&gt; +            continue;
&gt; +        g_main_loop_quit(m_runLoopMainLoops[i].get());
&gt; +    }

You should probably traverse the list backward since if a loop &gt; 1 is running, the ones before it are running too.

&gt; Source/WebCore/platform/gtk/RunLoopGtk.cpp:75
&gt; +GMainLoop* RunLoop::rootMainLoop()

I think I prefer the name innermostRunLoop. Would you mind changing this before landing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>565694</commentid>
    <comment_count>6</comment_count>
      <attachid>129009</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-02-27 08:57:37 -0800</bug_when>
    <thetext>Comment on attachment 129009
Patch Proposal

View in context: https://bugs.webkit.org/attachment.cgi?id=129009&amp;action=review

&gt; Source/WebCore/platform/gtk/RunLoopGtk.cpp:72
&gt; +    GDK_THREADS_ENTER();
&gt; +    g_main_loop_run(nestedMainLoop);
&gt; +    GDK_THREADS_LEAVE();

I don&apos;t think we should add this here. Note that RunLoop might be used to create run loops on any thread, that&apos;s why there&apos;s main() and current() static methods. So this can be used by a thread that doesn&apos;t even use GDK at all. So, I think the user should decide whether to use GDK_THREADS_ENTER/LEAVE, the UI process in the case of showModalDialog()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>565698</commentid>
    <comment_count>7</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-02-27 09:00:50 -0800</bug_when>
    <thetext>Sorry, I didn&apos;t meant to change the review flag</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>565705</commentid>
    <comment_count>8</comment_count>
      <attachid>129009</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-02-27 09:04:29 -0800</bug_when>
    <thetext>Comment on attachment 129009
Patch Proposal

View in context: https://bugs.webkit.org/attachment.cgi?id=129009&amp;action=review

&gt;&gt; Source/WebCore/platform/gtk/RunLoopGtk.cpp:72
&gt;&gt; +    GDK_THREADS_LEAVE();
&gt; 
&gt; I don&apos;t think we should add this here. Note that RunLoop might be used to create run loops on any thread, that&apos;s why there&apos;s main() and current() static methods. So this can be used by a thread that doesn&apos;t even use GDK at all. So, I think the user should decide whether to use GDK_THREADS_ENTER/LEAVE, the UI process in the case of showModalDialog()

Also, once the main loop has finished, you don&apos;t want to keep it in the vector, just remove it here</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>565706</commentid>
    <comment_count>9</comment_count>
      <attachid>129009</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-02-27 09:04:38 -0800</bug_when>
    <thetext>Comment on attachment 129009
Patch Proposal

View in context: https://bugs.webkit.org/attachment.cgi?id=129009&amp;action=review

&gt;&gt; Source/WebCore/platform/gtk/RunLoopGtk.cpp:72
&gt;&gt; +    GDK_THREADS_LEAVE();
&gt; 
&gt; I don&apos;t think we should add this here. Note that RunLoop might be used to create run loops on any thread, that&apos;s why there&apos;s main() and current() static methods. So this can be used by a thread that doesn&apos;t even use GDK at all. So, I think the user should decide whether to use GDK_THREADS_ENTER/LEAVE, the UI process in the case of showModalDialog()

I think I agree with cgarcia here. Do you mind removing these before landing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>565708</commentid>
    <comment_count>10</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-02-27 09:06:15 -0800</bug_when>
    <thetext>(In reply to comment #8)

&gt; Also, once the main loop has finished, you don&apos;t want to keep it in the vector, just remove it here

Presumably at that time ::stop has already been called and it&apos;s already removed...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>565713</commentid>
    <comment_count>11</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-02-27 09:10:27 -0800</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #8)
&gt; 
&gt; &gt; Also, once the main loop has finished, you don&apos;t want to keep it in the vector, just remove it here
&gt; 
&gt; Presumably at that time ::stop has already been called and it&apos;s already removed...

But here you have already checked it&apos;s not the main one, so that in stop you can simply call main_loop_quit, and you don&apos;t need to check whether vector size is &gt; 1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>565722</commentid>
    <comment_count>12</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-02-27 09:19:34 -0800</bug_when>
    <thetext>(In reply to comment #11)
&gt; (In reply to comment #10)
&gt; &gt; (In reply to comment #8)
&gt; &gt; 
&gt; &gt; &gt; Also, once the main loop has finished, you don&apos;t want to keep it in the vector, just remove it here
&gt; &gt; 
&gt; &gt; Presumably at that time ::stop has already been called and it&apos;s already removed...
&gt; 
&gt; But here you have already checked it&apos;s not the main one, so that in stop you can simply call main_loop_quit, and you don&apos;t need to check whether vector size is &gt; 1.

Good point. It does seem a bit cleaner to do that here rather than in ::stop.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>566478</commentid>
    <comment_count>13</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2012-02-28 00:56:07 -0800</bug_when>
    <thetext>Thank you Carlos and Martin for reviewing the patches. I will apply all the suggestions before landing, but before I need to get patch for bug 79496 reviewed too. So... &quot;ping, reviewers&quot;? :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>567125</commentid>
    <comment_count>14</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2012-02-28 14:50:20 -0800</bug_when>
    <thetext>(In reply to comment #12)
&gt;[...]
&gt; &gt; But here you have already checked it&apos;s not the main one, so that in stop you can simply call main_loop_quit, and you don&apos;t need to check whether vector size is &gt; 1.
&gt; 
&gt; Good point. It does seem a bit cleaner to do that here rather than in ::stop.

There&apos;s a problem with this: RunLoop::run() function is static, thus I don&apos;t have access to the m_runLoopMainLoops Vector there and I&apos;d need a removeLoastMainLoop function in a similar way I needed addNestedMainLoop(). 

That&apos;s why I do it in the stop function: I just quit the main loop and remove it from the Vector. I think it&apos;s equivalent and more clean, since ::stop is not an static function, and so I have access to the private Vector from there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>567131</commentid>
    <comment_count>15</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-02-28 14:59:02 -0800</bug_when>
    <thetext>(In reply to comment #14)

&gt; There&apos;s a problem with this: RunLoop::run() function is static, thus I don&apos;t have access to the m_runLoopMainLoops Vector there and I&apos;d need a removeLoastMainLoop function in a similar way I needed addNestedMainLoop(). 

A pair of functions sounds reasonable. Why not rename addNestedMainLoop(...) to pushNestedMainLoop and then add popNestedMainLoop. It&apos;s more obvious what they do then.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>567133</commentid>
    <comment_count>16</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2012-02-28 15:01:41 -0800</bug_when>
    <thetext>(In reply to comment #15)
&gt; (In reply to comment #14)
&gt; 
&gt; &gt; There&apos;s a problem with this: RunLoop::run() function is static, thus I don&apos;t have access to the m_runLoopMainLoops Vector there and I&apos;d need a removeLoastMainLoop function in a similar way I needed addNestedMainLoop(). 
&gt; 
&gt; A pair of functions sounds reasonable. Why not rename addNestedMainLoop(...) to pushNestedMainLoop and then add popNestedMainLoop. It&apos;s more obvious what they do then.

I just tried to minimize the number of new functions to add, but this idea of push and pop sounds good to me too. Will change before landing then.

Thanks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>567178</commentid>
    <comment_count>17</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2012-02-28 15:45:13 -0800</bug_when>
    <thetext>Committed r109161: &lt;http://trac.webkit.org/changeset/109161&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>128747</attachid>
            <date>2012-02-24 09:21:02 -0800</date>
            <delta_ts>2012-02-27 04:05:28 -0800</delta_ts>
            <desc>Patch Proposal</desc>
            <filename>0001-2012-02-24-Mario-Sanchez-Prada-msanchez-igalia.com.patch</filename>
            <type>text/plain</type>
            <size>3231</size>
            <attacher name="Mario Sanchez Prada">mario</attacher>
            
              <data encoding="base64">RnJvbSA4ZjY4YjkwMjQxOTM0NmQ3ZTZjNGRjYTM4N2U0YmJkY2NjNWM4MTU5IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXJpbyBTYW5jaGV6IFByYWRhIDxtc2FuY2hlekBpZ2FsaWEu
Y29tPgpEYXRlOiBGcmksIDI0IEZlYiAyMDEyIDE3OjU0OjIyICswMTAwClN1YmplY3Q6IFtQQVRD
SF0gMjAxMi0wMi0yNCAgTWFyaW8gU2FuY2hleiBQcmFkYSAgPG1zYW5jaGV6QGlnYWxpYS5jb20+
CgogICAgICAgIFtHVEtdIEFkZCBzdXBwb3J0IGZvciBuZXN0ZWQgZXZlbnQgbG9vcHMgaW4gUnVu
TG9vcAogICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD03OTQ5
OQoKICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KCiAgICAgICAgUnVuIGEgbmV3
IG5lc3RlZCBtYWlubG9vcCBpZiB0aGUgbWFpbiBldmVudCBsb29wIGlzIGFscmVhZHkKICAgICAg
ICBydW5uaW5nIHdoZW4gY2FsbGluZyB0byBSdW5Mb29wOjpydW4oKSwgYW5kIHRha2UgY2FyZSBv
ZiBzdG9wcGluZwogICAgICAgIHRoZSByaWdodCBtYWluIGxvb3AgdG9vIHdoZW4gUnVuTG9vcDo6
c3RvcCgpIGlzIGludm9rZWQuCgogICAgICAgICogcGxhdGZvcm0vZ3RrL1J1bkxvb3BHdGsuY3Bw
OgogICAgICAgIChXZWJDb3JlKToKICAgICAgICAoV2ViQ29yZTo6UnVuTG9vcDo6cnVuKToKICAg
ICAgICAoV2ViQ29yZTo6UnVuTG9vcDo6c3RvcCk6Ci0tLQogU291cmN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29wX3F1aXQobV9ydW5Mb29wTWFpbi5nZXQoKSk7CiB9CiAKIGdib29sZWFuIFJ1bkxvb3A6OnF1
ZXVlV29yayhSdW5Mb29wKiBydW5Mb29wKQotLSAKMS43LjcuNQoK
</data>
<flag name="review"
          id="131222"
          type_id="1"
          status="-"
          setter="mrobinson"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>129009</attachid>
            <date>2012-02-27 04:05:28 -0800</date>
            <delta_ts>2012-02-27 09:04:38 -0800</delta_ts>
            <desc>Patch Proposal</desc>
            <filename>0001-GTK-Add-support-for-nested-event-loops-in-RunLoop.patch</filename>
            <type>text/plain</type>
            <size>5563</size>
            <attacher name="Mario Sanchez Prada">mario</attacher>
            
              <data encoding="base64">RnJvbSA3Mzk2YTk1ZDNkOTU3YmRmZDJhMGQ1YmE4NWUwOGI2NWUzYjMzZWUzIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXJpbyBTYW5jaGV6IFByYWRhIDxtc2FuY2hlekBpZ2FsaWEu
Y29tPgpEYXRlOiBNb24sIDI3IEZlYiAyMDEyIDEwOjI3OjQ0ICswMTAwClN1YmplY3Q6IFtQQVRD
SF0gW0dUS10gQWRkIHN1cHBvcnQgZm9yIG5lc3RlZCBldmVudCBsb29wcyBpbiBSdW5Mb29wCiBo
dHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9Nzk0OTkKClJldmlld2VkIGJ5
IE5PQk9EWSAoT09QUyEpLgoKUnVuIGEgbmV3IG5lc3RlZCBtYWlubG9vcCBpZiB0aGUgbWFpbiBl
dmVudCBsb29wIGlzIGFscmVhZHkKcnVubmluZyB3aGVuIGNhbGxpbmcgdG8gUnVuTG9vcDo6cnVu
KCksIGFuZCB0YWtlIGNhcmUgb2Ygc3RvcHBpbmcKdGhlIHJpZ2h0IG1haW4gbG9vcCB0b28gd2hl
biBSdW5Mb29wOjpzdG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0KCkpKQorICAgICAgICBnX21haW5fbG9vcF9xdWl0KGxhc3RNYWluTG9vcC5nZXQoKSk7
CisKKyAgICAvLyBBdm9pZCBsb3NpbmcgdGhlIHJvb3QgbWFpbiBsb29wIGlmIHdlIHN0b3AgaXQu
CisgICAgaWYgKG1fcnVuTG9vcE1haW5Mb29wcy5zaXplKCkgPiAxKQorICAgICAgICBtX3J1bkxv
b3BNYWluTG9vcHMucmVtb3ZlTGFzdCgpOwogfQogCiBnYm9vbGVhbiBSdW5Mb29wOjpxdWV1ZVdv
cmsoUnVuTG9vcCogcnVuTG9vcCkKLS0gCjEuNy43LjUKCg==
</data>
<flag name="review"
          id="131545"
          type_id="1"
          status="+"
          setter="mrobinson"
    />
    <flag name="commit-queue"
          id="131593"
          type_id="3"
          status="-"
          setter="mrobinson"
    />
          </attachment>
      

    </bug>

</bugzilla>