Why does Chromium WebView on Android run in single-process mode?

2,684 views
Skip to first unread message

anders.e...@sonymobile.com

unread,
Nov 21, 2013, 9:04:23 AM11/21/13
to chromi...@chromium.org

We noticed that the new Chromium-based WebView on Android 4.4 runs in single-process mode,
and that presumably this is the reason why certain features are missing. For example, WebGL,
WebRTC, webaudio, etc.

    - What is the reason behind this design?

    - Is it likely that the WebView will remain single-process for the foreseeable future, or is a
      multi-process version in the works?

    - If it remains single-process, will the missing features be implemented, or will the WebView
      continue to lack things like WebGL?

/Anders

David Turner

unread,
Nov 21, 2013, 9:49:36 AM11/21/13
to anders.e...@sonymobile.com, chromium-dev
On Thu, Nov 21, 2013 at 3:04 PM, <anders.e...@sonymobile.com> wrote:

We noticed that the new Chromium-based WebView on Android 4.4 runs in single-process mode,
and that presumably this is the reason why certain features are missing. For example, WebGL,
WebRTC, webaudio, etc.

    - What is the reason behind this design?

Because on Android you can't create processes nilly-willy :-). They need to be started by the framework itself. For example, for Chrome we actually start a new bound service in its own process to host a renderer, and this requires specific bits in the application manifest, specific (and complicated) logic in the application itself.
This doesn't scale at all to liberal applications that want to just use a WebView. Also, it uses much more memory :-( Note that the previous WebView was also single-process, by design.
 
    - Is it likely that the WebView will remain single-process for the foreseeable future, or is a
      multi-process version in the works?

I'm not aware of such plans.
 
    - If it remains single-process, will the missing features be implemented, or will the WebView
      continue to lack things like WebGL?

I don't know the details why these are not available in WebViews at the moment. I doubt it's strictly related to single-process-mode though. For example, it might be that some of these APIs require permissions the app may not have. I hope other engineers could chime in to complete the picture though.
 
/Anders

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

Bo Liu

unread,
Nov 21, 2013, 12:13:37 PM11/21/13
to di...@chromium.org, anders.e...@sonymobile.com, chromium-dev
On Thu, Nov 21, 2013 at 6:49 AM, David Turner <di...@chromium.org> wrote:



On Thu, Nov 21, 2013 at 3:04 PM, <anders.e...@sonymobile.com> wrote:

We noticed that the new Chromium-based WebView on Android 4.4 runs in single-process mode,
and that presumably this is the reason why certain features are missing. For example, WebGL,
WebRTC, webaudio, etc.

Lack of these features has nothing to do with single process. We plan on implementing these features for webview.
 

    - What is the reason behind this design?

Because on Android you can't create processes nilly-willy :-). They need to be started by the framework itself. For example, for Chrome we actually start a new bound service in its own process to host a renderer, and this requires specific bits in the application manifest, specific (and complicated) logic in the application itself.
This doesn't scale at all to liberal applications that want to just use a WebView. Also, it uses much more memory :-( Note that the previous WebView was also single-process, by design.

In addition, being an android view imposes some additional synchronicity requirements that is very difficult to fulfill in chrome's multi-process design.
 
 
    - Is it likely that the WebView will remain single-process for the foreseeable future, or is a
      multi-process version in the works?

I'm not aware of such plans.

Do you have a specific use case for multi-process webview?

anders.e...@sonymobile.com

unread,
Nov 22, 2013, 4:26:22 AM11/22/13
to chromi...@chromium.org, di...@chromium.org, anders.e...@sonymobile.com, bo...@chromium.org

Thanks for clarifying this!

No, we do not have any preference for multi-process, on the contrary (single-process seems less power-hungry).
It is just that we were a bit disappointed by the feature gap between the WebView and the Chrome browser,
but it sounds like that gap will be closed eventually. That is what I wanted to hear!

/Anders

Xinwen Xue

unread,
Dec 20, 2013, 5:57:58 AM12/20/13
to chromi...@chromium.org, di...@chromium.org, anders.e...@sonymobile.com, bo...@chromium.org
Hi all,
What about rendering performance? Does single process mode have lower performance comparing with multiple process mode? Thanks.

在 2013年11月22日星期五UTC+8上午1时13分37秒,Bo Liu写道:

Bo Liu

unread,
Dec 20, 2013, 12:14:50 PM12/20/13
to Xinwen Xue, chromium-dev, di...@chromium.org, anders.e...@sonymobile.com
On Fri, Dec 20, 2013 at 2:57 AM, Xinwen Xue <xinwe...@gmail.com> wrote:
Hi all,
What about rendering performance? Does single process mode have lower performance comparing with multiple process mode? Thanks.

No. Any difference between multiprocess and multithread should not be significant enough to be noticeable to users.

Webview's rendering and threading architecture is different from chrome, and what you are probably wanted to know is whether this hurts webview's performance. The answer is depends. Webview merges some chrome threads into a single one. The down side is webview is more suspetible to thread contention and may not take advantage of large number of cpu cores. The up side is that there is generally less thread hopping, so webview has an easier time performing consistently on less powerful hardware.

awais rana

unread,
Dec 16, 2018, 9:48:45 PM12/16/18
to Chromium-dev, anders.e...@sonymobile.com
google should do something about.because we also can,t use service worker,and also the major problem.when you load webpage in webview and trying to maker recursion with two or more functions.it does,t work 

Torne (Richard Coles)

unread,
Dec 17, 2018, 12:19:05 PM12/17/18
to awaisra...@gmail.com, Chromium-dev, anders.e...@sonymobile.com
Service workers have been expected to work on WebVIew for quite a long time now - you don't need multiple processes to enable them to function. If you're experiencing problems with it, file a bug with specific information about what you're doing and what doesn't work. I'm also not sure what you mean about recursion - there shouldn't be any behavioural difference with JS code as a result of being single-process.

WebView also now *is* multi-process on most Android O and later devices; this won't change for earlier OS versions because some platform functionality that we require to reduce memory usage and startup time isn't present, but going forward it's fine.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/fe1b69bd-4646-4f28-b4c2-f521c522aca1%40chromium.org.
Reply all
Reply to author
Forward
0 new messages