Add initial chrome runtime support (see issue #2969)

Running `cefsimple --enable-chrome-runtime` will create and run a
Chrome browser window using the CEF app methods, and call
CefApp::OnContextInitialized as expected. CEF task methods also
work as expected in the main process. No browser-related methods or
callbacks are currently supported for the Chrome window, and the
application will exit when the last Chrome window closes.

The Chrome runtime requires resources.pak, chrome_100_percent.pak
and chrome_200_percent.pak files which were not previously built
with CEF. It shares the existing locales pak files which have been
updated to include additional Chrome-specific strings.

On Linux, the Chrome runtime requires GTK so use_gtk=true must be
specified via GN_DEFINES when building.

This change also refactors the CEF runtime, which can be tested in
the various supported modes by running:
$ cefclient
$ cefclient --multi-threaded-message-loop
$ cefclient --external-message-pump
This commit is contained in:
Marshall Greenblatt
2020-06-24 22:34:12 -04:00
parent 049caf9131
commit 1174994211
37 changed files with 994 additions and 158 deletions

View File

@@ -192,6 +192,13 @@ typedef struct _cef_settings_t {
///
cef_string_t main_bundle_path;
///
// Set to true (1) to enable use of the Chrome runtime in CEF. This feature is
// considered experimental and is not recommended for most users at this time.
// See issue #2969 for details.
///
int chrome_runtime;
///
// Set to true (1) to have the browser process message loop run in a separate
// thread. If false (0) than the CefDoMessageLoopWork() function must be

View File

@@ -569,6 +569,7 @@ struct CefSettingsTraits {
&target->framework_dir_path, copy);
cef_string_set(src->main_bundle_path.str, src->main_bundle_path.length,
&target->main_bundle_path, copy);
target->chrome_runtime = src->chrome_runtime;
target->multi_threaded_message_loop = src->multi_threaded_message_loop;
target->external_message_pump = src->external_message_pump;
target->windowless_rendering_enabled = src->windowless_rendering_enabled;