WebView Chromium

31 views
Skip to first unread message

Sankarshana Madhavarao

unread,
Feb 2, 2015, 8:04:37 PM2/2/15
to chromiu...@chromium.org
Hi,

In Android WebView , (Android 4.4) onwards, I understand that, WebSocket is supported out of the box.

In this context, if I use WebView to load HTML pages that in turn uses WebSocket client of Javascript, question is, the OnMessage() of WebSokcet gets called on main UI thread or in some other context.

If I rapidly send multiple messages from WebSocket Server to WebSocket JS client, do the OnMessage gets called serially or there is a chance that it 2 instances of OnMessage() can exist simultanelusly.


Thanks

PhistucK

unread,
Feb 3, 2015, 1:44:41 AM2/3/15
to Sankarshana Madhavarao, Chromium HTML5
JavaScript has only one thread (excluding Web Worker and similar), so I believe it should be called on the main thread of the WebView. The messages will be processed serially, I believe.


PhistucK

--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-html...@chromium.org.
To post to this group, send email to chromiu...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Mikhail Naganov

unread,
Feb 3, 2015, 3:39:59 AM2/3/15
to Sankarshana Madhavarao, chromiu...@chromium.org
Hi Sankarshana,

JavaScript code runs on a separate thread from the app's main UI thread (in Chromium's terms, the app's main UI thread is called "browser UI thread", and JavaScript runs on the "render thread").

OnMessage must be called serially. JavaScript doesn't allow interruptions of code execution.

--

Sankarshana Madhavarao

unread,
Feb 4, 2015, 8:00:07 PM2/4/15
to mnag...@chromium.org, chromiu...@chromium.org
Thanks all for response.

Is there a threading model documentation to know different aspects when webview is used ( not full
Chrome browser)



Thx

Sent from my iPhone

Mikhail Naganov

unread,
Feb 5, 2015, 3:39:08 AM2/5/15
to Sankarshana Madhavarao, chromiu...@chromium.org
You can take a look at this page which has links to some documentation: http://dev.chromium.org/developers/androidwebview
Reply all
Reply to author
Forward
0 new messages