自定义CEF构建并删除未使用的Chromium功能

时间:2017-12-22 06:49:36

标签: windows chromium-embedded

我需要用最少的功能编译cef3。我不需要print / media / devtools等功能。如何在构建期间禁用它?在不禁用其他功能的情况下使用cef3会占用单个实例大约100MB的内存,因此如果应用程序适用于多个实例,则无法使用它。

我想减少cef3的内存使用量。

我查看了BUILD.gn和gni文件,但无法找到禁用功能的地方。

1 个答案:

答案 0 :(得分:0)

我不认为禁用上述功能会很容易。但是你可以尝试以下几点:

1)运行python automate-git.py --help以提供有关如何使构建运行更快的选项列表

2)检查文件cef\tests\shared\common\client_switches.cc以获取一些支持的命令行开关。我引用该文件:

// CEF and Chromium support a wide range of command-line switches. This file
// only contains command-line switches specific to the cefclient application.
// View CEF/Chromium documentation or search for *_switches.cc files in the
// Chromium source code to identify other existing command-line switches.
// Below is a partial listing of relevant *_switches.cc files:
//   base/base_switches.cc
//   cef/libcef/common/cef_switches.cc
//   chrome/common/chrome_switches.cc (not all apply)
//   content/public/common/content_switches.cc

3)请参阅List of Chromium Command Line Switches - 您会发现许多有用的CLI切换,例如--disable-extensions

4)我还发现Electron - Supported Chrome Command Line Switches提及--disable-http2并根据this stackoverflow post确实有效。

P.S。我不认为您可以在构建过程中轻松删除功能。

相关问题