On Apr 14, 8:25 pm, Boris Zbarsky <[email protected]> wrote:
> On 4/14/10 5:17 PM, hap497 wrote:
>
> > 1. I have 2 Windows in Firefox, there should be 1 Main/UI Thread,
> > right?
>
> Yes.
>
> > 2. In 1 window, I load a page which has a JavaScript confirm dialog,
> > this should block the Main/UI Thread.
>
> It doesn't.  It blocks the code that called it, but spins the main UI
> thread event loop while the dialog is up.  Yes, this means that if you
> set things just up right the code that posed the modal dialog can be
> reentered, breaking run-to-completion semantics.  You have to try pretty
> hard, though.
>
> -Boris

Thank you for your answer.
You said " It doesn't.  It blocks the code that called it."
I have tried captured a stack dump in debugger. The function
EmbedPrompter::Create() is called from g_main_context_dispatch(). So
if EmbedPrompter::Create() is blocked by the modal dialog of the
JavaScript Alert, it blocks the main UI thread, right?

#0  EmbedPrompter::Create (this=0xbfb98098,
aType=EmbedPrompter::TYPE_ALERT, aParentWindow=0x809d030)
    at /home/hap497/mozilla/ff-3.6_192src/embedding/browser/gtk/src/
EmbedPrompter.cpp:104
#1  0xb690257d in GtkPromptService::Alert (this=0x805bd60,
aParent=0x83ec278, aDialogTitle=0xbfb98250,
    aDialogText=0xbfb981bc)
    at /home/hap497/mozilla/ff-3.6_192src/embedding/browser/gtk/src/
GtkPromptService.cpp:68
#2  0xb65a9c6b in nsPrompt::Alert (this=0x85db708,
dialogTitle=0xbfb98250, text=0xbfb981bc)
//...... omitted
#18 0xb3e7ab9e in nsAppShell::EventProcessorCallback
(source=0x8359c90, condition=G_IO_IN,
    data=0x8359ba0) at /home/hap497/mozilla/ff-3.6_192src/widget/src/
gtk2/nsAppShell.cpp:70
#19 0xb705f01d in ?? () from /usr/lib/libglib-2.0.so.0
#20 0xb702acf6 in g_main_context_dispatch () from /usr/lib/
libglib-2.0.so.0
#21 0xb702e0b3 in ?? () from /usr/lib/libglib-2.0.so.0
#22 0xb702e497 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#23 0xb73b0264 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#24 0x0804c4aa in main (argc=136505016, argv=0xbfb9a3a4)
    at /home/hap497/mozilla/ff-3.6_192src/embedding/browser/gtk/tests/
TestGtkEmbed.cpp:267
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to