From 12362a83e22e39473ebb45b6fe5ae9fc21043428 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 10 Sep 2012 16:15:21 +0000 Subject: [PATCH] Merge revision 774 changes: - Propagate logging command-line parameters to all processes (issue #717). git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1180@775 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- cef3/libcef/browser/content_browser_client.cc | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/cef3/libcef/browser/content_browser_client.cc b/cef3/libcef/browser/content_browser_client.cc index 8f97a068c..99c79a906 100644 --- a/cef3/libcef/browser/content_browser_client.cc +++ b/cef3/libcef/browser/content_browser_client.cc @@ -93,23 +93,33 @@ void CefContentBrowserClient::RenderProcessHostCreated( void CefContentBrowserClient::AppendExtraCommandLineSwitches( CommandLine* command_line, int child_process_id) { + const CommandLine& browser_cmd = *CommandLine::ForCurrentProcess(); + + { + // Propagate the following switches to all command lines (along with any + // associated values) if present in the browser command line. + static const char* const kSwitchNames[] = { + switches::kLogFile, + switches::kLogSeverity, + }; + command_line->CopySwitchesFrom(browser_cmd, kSwitchNames, + arraysize(kSwitchNames)); + } + std::string process_type = command_line->GetSwitchValueASCII(switches::kProcessType); if (process_type == switches::kRendererProcess) { - // Propagate the following switches to the renderer command line (along - // with any associated values) if present in the browser command line. - static const char* const kSwitchNames[] = { - switches::kLogFile, - switches::kLogSeverity, - switches::kProductVersion, - switches::kLocale, - switches::kResourcesDirPath, - switches::kLocalesDirPath, - switches::kPackLoadingDisabled, - }; - const CommandLine& browser_cmd = *CommandLine::ForCurrentProcess(); - command_line->CopySwitchesFrom(browser_cmd, kSwitchNames, - arraysize(kSwitchNames)); + // Propagate the following switches to the renderer command line (along with + // any associated values) if present in the browser command line. + static const char* const kSwitchNames[] = { + switches::kProductVersion, + switches::kLocale, + switches::kResourcesDirPath, + switches::kLocalesDirPath, + switches::kPackLoadingDisabled, + }; + command_line->CopySwitchesFrom(browser_cmd, kSwitchNames, + arraysize(kSwitchNames)); } }