cefsimple: Minor code and docs cleanup

This commit is contained in:
Marshall Greenblatt
2024-01-17 17:44:33 -05:00
parent f1fe098e09
commit 468e55e553
4 changed files with 23 additions and 21 deletions

View File

@@ -151,11 +151,9 @@ void SimpleHandler::CloseAllBrowsers(bool force_close) {
// static
bool SimpleHandler::IsChromeRuntimeEnabled() {
static int value = -1;
if (value == -1) {
CefRefPtr<CefCommandLine> command_line =
CefCommandLine::GetGlobalCommandLine();
value = command_line->HasSwitch("enable-chrome-runtime") ? 1 : 0;
}
return value == 1;
static bool enabled = []() {
return CefCommandLine::GetGlobalCommandLine()->HasSwitch(
"enable-chrome-runtime");
}();
return enabled;
}