Logging: pass logging related cmd line options to utility process

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
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc
index 6c7dd9c90..c10d82db 100644
--- a/content/browser/browser_child_process_host_impl.cc
+++ b/content/browser/browser_child_process_host_impl.cc
@@ -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"
@@ -121,10 +122,20 @@
   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)