Page 1 of 1

Render process grouping based on a query parameter

PostPosted: Thu Nov 24, 2016 4:48 am
by aneeshm
Hi All,

We are using CEF inside our web authoring tool for Live Preview of the document contents. We create one CEF instance per document. With the multi process model, CEF creates a render process for each document opened. So when the user opens a good number of documents, then the memory consumption is going up with every new Render process. We would like to have a less number of Render processes.

There is a command line flag in Chromium to group processes based on site. But this will not be useful for us as all the documents we preview are local files (file://). Hence we are looking at some other method for grouping processes. One method we tried is to use a query parameter (eg: file://path?group=true) to convey that this CEF instance should be included in the process group. We have made an experimental Chromium/Blink patch also to make this work. How useful will this be for others?

/- Aneesh

Re: Render process grouping based on a query parameter

PostPosted: Thu Nov 24, 2016 5:37 am
by Czarek
How about using --process-per-site along with a custom scheme handler to access local files?

EDIT: Or handling special domain like "http://file.system/c/Windows/some.txt" using CefRequestHandler::GetResourceHandler?

Re: Render process grouping based on a query parameter

PostPosted: Thu Nov 24, 2016 1:36 pm
by magreenblatt
What do you mean by "CEF instance" per document?

If you are creating separate CefBrowsers then they should share the same renderer process if you do the following:

1. Create all CefBrowsers with the same (or NULL) CefRequestContext.
2. Load all URLs from the same origin. Use a custom scheme handler instead of the file scheme.