[Webkit-unassigned] [Bug 124043] [GTK] Crash when printing via javascript in WebKit2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 8 09:21:07 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=124043





--- Comment #4 from Martin Robinson <mrobinson at webkit.org>  2013-11-08 09:19:52 PST ---
(From update of attachment 216401)
View in context: https://bugs.webkit.org/attachment.cgi?id=216401&action=review

> Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:732
> +    GMainLoop* mainLoop;
> +    unsigned idlePriority;
> +    if (m_printMode == PrintInfo::PrintModeSync) {
> +        ASSERT(data->mainLoop);
> +        mainLoop = data->mainLoop.get();
> +
> +        // Make sure the print pages idle has more priority than IPC messages comming from
> +        // the IO thread, so that the EndPrinting message is always handled once the print
> +        // operation has finished. See https://bugs.webkit.org/show_bug.cgi?id=122801.
> +        idlePriority = G_PRIORITY_DEFAULT - 10;
> +    } else {
> +        mainLoop = 0;
> +        idlePriority = G_PRIORITY_DEFAULT_IDLE + 10;
> +    }
> +    m_printPagesIdleId = gdk_threads_add_idle_full(idlePriority, printPagesIdle, data.leakPtr(), printPagesIdleDone);
> +    if (mainLoop)
> +        g_main_loop_run(mainLoop);

What do you think about simplifying this to something like:

// Make sure the print pages idle has more priority than IPC messages comming from
// the IO thread, so that the EndPrinting message is always handled once the print
// operation has finished. See https://bugs.webkit.org/show_bug.cgi?id=122801.
unsigned idlePriority = m_printMode == PrintInfo::PrintModeSync ? G_PRIORITY_DEFAULT - 10 : G_PRIORITY_DEFAULT_IDLE + 10;
m_printPagesIdleId = gdk_threads_add_idle_full(idlePriority, printPagesIdle, data.leakPtr(), printPagesIdleDone);
if (m_printMode == PrintInfo::PrintModeSync) {
    ASSERT(data->mainLoop);
    g_main_loop_run(data->mainLoop);
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list