Skip to content

Commit

Permalink
Logging: pass logging related cmd line options to utility process
Browse files Browse the repository at this point in the history
Logging doesn't work in utility process due to the related command line
options are not passed to utility process. For example, run
" ./chrome --vmodule=unpacker=1 --enable-logging=stderr", DVLOG(1)
message in unpacker.cc can not be output correctly. This patch passes the
related command line options to utility process.

BUG=
TEST=--enable-logging=stderr --vmodule=unpacker=1, then open  chrome://extensions, drag a foo.crx in the page, you can see the DVLOG message " Installing extension ".

Review URL: https://chromiumcodereview.appspot.com/11103028

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162665 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
qiankun.miao@intel.com committed Oct 18, 2012
1 parent 88d7112 commit 2b065f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,4 @@ Dai Chunyang <chunyang.dai@intel.com>
Joe Thomas <mhx348@motorola.com>
Ruben Terrazas <rubentopo@gmail.com>
Josh Triplett <josh.triplett@intel.com>
Qiankun Miao <qiankun.miao@intel.com>
15 changes: 13 additions & 2 deletions content/browser/browser_child_process_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "content/browser/browser_child_process_host_impl.h"

#include "base/base_switches.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/file_path.h"
Expand Down Expand Up @@ -121,10 +122,20 @@ void BrowserChildProcessHostImpl::Launch(
content::GetContentClient()->browser()->AppendExtraCommandLineSwitches(
cmd_line, data_.id);

const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
static const char* kForwardSwitches[] = {
#if defined(OS_POSIX)
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChildCleanExit))
cmd_line->AppendSwitch(switches::kChildCleanExit);
switches::kChildCleanExit,
#endif
switches::kDisableLogging,
switches::kEnableDCHECK,
switches::kEnableLogging,
switches::kLoggingLevel,
switches::kV,
switches::kVModule,
};
cmd_line->CopySwitchesFrom(browser_command_line, kForwardSwitches,
arraysize(kForwardSwitches));

child_process_.reset(new ChildProcessLauncher(
#if defined(OS_WIN)
Expand Down
6 changes: 0 additions & 6 deletions content/browser/plugin_process_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,6 @@ bool PluginProcessHost::Init(const webkit::WebPluginInfo& info) {
#if defined(OS_MACOSX)
switches::kDisableCompositedCoreAnimationPlugins,
switches::kDisableCoreAnimationPlugins,
#endif
switches::kDisableLogging,
switches::kEnableDCHECK,
switches::kEnableLogging,
#if defined(OS_MACOSX)
switches::kEnableSandboxLogging,
#endif
switches::kEnableStatsTable,
Expand All @@ -202,7 +197,6 @@ bool PluginProcessHost::Init(const webkit::WebPluginInfo& info) {
switches::kTraceStartup,
switches::kUseGL,
switches::kUserAgent,
switches::kV,
};

cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
Expand Down
2 changes: 0 additions & 2 deletions content/browser/worker_host/worker_process_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,9 @@ bool WorkerProcessHost::Init(int render_process_id) {
switches::kDisableFileSystem,
switches::kDisableSeccompFilterSandbox,
switches::kDisableWebSockets,
switches::kEnableLogging,
#if defined(OS_MACOSX)
switches::kEnableSandboxLogging,
#endif
switches::kLoggingLevel,
};
cmd_line->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), kSwitchNames,
arraysize(kSwitchNames));
Expand Down

0 comments on commit 2b065f8

Please sign in to comment.