On Wed, Jun 10, 2009 at 10:19 PM, Meryl Silverburgh <
silverburgh.me...@gmail.com> wrote:

> On Wed, Jun 10, 2009 at 12:18 PM, John Abd-El-Malek<j...@chromium.org>
> wrote:
> >
> >
> > On Wed, Jun 10, 2009 at 11:48 AM, Meryl Silverburgh
> > <silverburgh.me...@gmail.com> wrote:
> >>
> >> From this document, it talks about Messaging between
> >>
> >>
> http://dev.chromium.org/developers/design-documents/displaying-a-web-page-in-chrome
> >>
> >> Can you please help me understand what is the Message Flow for an Alert
> >> Dialog?
> >>
> >> like in this case:
> >> <html><script> function f1() { var a = 1; alert("hello"); a = 2;};
> >> f1(); </script></html>
> >>
> >> I assume it is like this, please correct me if i am wrong:
> >> 1. Browser Process downloads the test page
> >> 2. Renderer Process gets the html source, parses the html and have v8
> >> executes script node
> >> 3. v8 pauses at 'alert' call, sends a message to Browser Process to
> >> pop up the alert dialog and Render Process blocked till it receives
> >> message from Browser.
> >> 4. Browser Process shows the alert dialog with the right message (in
> >> this case 'hello')
> >> 5. When user clicks 'Okay', browser process sends a message back to
> >> Renderer Process and v8 continues execute the rest of the Script node.
> >>
> >> Is this correct?
> >
> > Yep this is pretty much what happens.  For more details, search
> > for ViewHostMsg_RunJavaScriptMessage
> >
>
> Thank you. John.
>
> I think this method is Render process to send a message to Browser
> process to pop up an alert dialog.
> bool RenderView::RunJavaScriptMessage(int type,
>                                      const std::wstring& message,
>                                      const std::wstring& default_value,
>                                      const GURL& frame_url,
>                                      std::wstring* result)
>
> that calls:
> bool Channel::Send(Message* message);
> and then
> bool Channel::ChannelImpl::ProcessOutgoingMessages()
>
> My question is how the Render process being blocked after it sends the
> message to Browser process, which one is a blocking calls or which one
> calls a blocking method?
> And how it will resume when Browser process replys a message? How
> Render is being resumed (which method does that)?


This is done automatically since ViewHostMsg_RunJavaScriptMessage is
declared as a synchronous IPC message (see render_messages_internal.h).

The code that does the waiting until the browser replies is
IPC::SyncChannel.  See Send() in ipc_sync_channel.cc.

>
>
> Thank you.
>
>
> >>
> >> Thank you for any clarificaiton.
> >>
> >> > >>
> >
> >
>

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to