2010-12-28 Martin Robinson <mrobinson@igalia.com>
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Dec 2010 00:39:42 +0000 (00:39 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Dec 2010 00:39:42 +0000 (00:39 +0000)
commitedf639744b93aaebb3f9438d47b1e0b7420ca22b
treeb26bc21e1af83a7493ba91595235a4e94ea83fca
parentbfa4e0b5161adb155a8878d35720044eb3e0b475
2010-12-28  Martin Robinson  <mrobinson@igalia.com>

        Reviewed by Xan Lopez.

        [GTK] Closing a window during an onload event can trigger serious GLib warnings
        https://bugs.webkit.org/show_bug.cgi?id=51686

        Don't emit the close-web-view signal immediately during execution of closeWindowSoon.
        The signal handler may choose to destroy the web view while handling that signal,
        which may remove the last reference to the web view. FrameLoaderClient depends on the
        view still existing though. Instead, let the caller finish executing and emit the signal
        after a 0 length timeout. This matches the behavior on the Windows and Mac ports.

        * WebCoreSupport/ChromeClientGtk.cpp:
        (WebKit::ChromeClient::ChromeClient): Initialize the timer id.
        (WebKit::emitCloseWebViewSignalLater): Callback for the timer.
        (WebKit::ChromeClient::closeWindowSoon): Do the actual signal invocation after
        the caller finishes its tasks.
        * WebCoreSupport/ChromeClientGtk.h: Add a new member for the timer id. We
        can use this to prevent emitting the close-web-view signal twice.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
WebKit/gtk/WebCoreSupport/ChromeClientGtk.h