RuidSiel / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 1 forks source link

Introduce multi-process architecture in CEF #326

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
(Separated from issue #304).

CEF currently uses the Chromium single-process architecture. The single-process 
architecture receives less attention from Google developers and consequently 
lags the multi-process architecture in rendering performance and features. It 
should be possible to build CEF on top of the same multi-process architecture 
that the Chrome browser currently uses.

The "best" implementation approach, as demonstrated by CEF2 
(http://magpcss.org/ceforum/viewtopic.php?f=10&t=122), is to host the browser 
window out-of-process. This allows the browser and client message loops to 
operate completely independently of each other.

I started a thread about hosting an out-of-process browser window here:
http://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/
1f97d07179654f71

The conclusion is that out-of-process browser windows can be used on Windows 
and Linux but not Mac. This means that CEF can provide optimal rendering 
performance on Windows and Linux by hosting the complete browser window 
out-of-process. On Mac the only option is to host the browser window in-process 
which will require integration with the NSApplication message loop and may 
result in sub-optimal rendering performance compared to Windows and Linux.

Original issue reported on code.google.com by magreenb...@gmail.com on 1 Sep 2011 at 5:57

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 13 Nov 2011 at 2:55

GoogleCodeExporter commented 9 years ago
The approach currently under consideration is re-architecting CEF using the 
content module: http://www.chromium.org/developers/content-module/

Advantages:

* Support both single-process and multi-process run modes.
* More code sharing with the Chromium browser.
* Improved performance and less breakage due to use of the "supported" code 
path.
* Faster access to new features.

Disadvantages:

* Content module is still a moving target.
* Some existing features will not be immediately available in the new 
architecture.
* Binary file count and distribution size will increase.
* Multi-process implementations for features like native V8 bindings/extensions 
and embedded NPAPI plugins will add additional complexity.
* Off-screen rendering implementation will be significantly more complex 
(requires a custom RenderWidgetHostView implementation).

Plan:

The basic features that CEF requires (page load notifications, context menus, 
cookie access, etc) should work with content in both single process and multi 
process modes "out of the box" because they're already plumbed through the 
browser process. Start by getting those features working and then look at what 
makes sense for the more complex features that may require additional plumbing 
to the render process.

The existing CEF API will be preserved as much as reasonably possible. The 
following changes should be expected:

1. Many functions that currently return values directly will instead accept 
callbacks to be executed when the value is available. This is to avoid blocking 
across processes in the new architecture.

2. The C API may be changed to make binding to other languages easier by 
reducing the use of function pointers. It would also be nice to allow pointer 
comparisons on the client side (currently not possible due to the wrapper class 
implementation). The exact plans for this remain to be determined.

This new version of CEF will likely be called CEF3. It will be released 
publicly once a basic working version is in place. The current estimated 
timeline for the initial version is 1-2 months with prolonged development to 
follow.

Original comment by magreenb...@gmail.com on 23 Nov 2011 at 11:46

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 23 Nov 2011 at 11:49

GoogleCodeExporter commented 9 years ago
> Support both single-process and multi-process run modes.
It is really possible?

Original comment by fdd...@gmail.com on 24 Nov 2011 at 9:17

GoogleCodeExporter commented 9 years ago
Oh, and i works on similar project, but my goal, it is creating cross-platform 
runtime. Unfortunately almost all UI frameworks hides implementation details - 
so often embedding browser about impossible, or it is can be done only with 
hacks and limitations. Writing applications for each platform separately - it's 
not my way.
In any case - i wish good luck for CEF3!

Original comment by fdd...@gmail.com on 24 Nov 2011 at 9:30

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 23 Dec 2011 at 5:39

GoogleCodeExporter commented 9 years ago
Done. See http://magpcss.org/ceforum/viewtopic.php?f=10&t=645 for details.

Original comment by magreenb...@gmail.com on 13 Feb 2012 at 7:20

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 3 Oct 2012 at 4:53