diff options
author | craig.schlenter@chromium.org <craig.schlenter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-19 10:49:32 +0000 |
---|---|---|
committer | craig.schlenter@chromium.org <craig.schlenter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-19 10:49:32 +0000 |
commit | ccaddf9653bd5ddb1ae1426cfa61572385ed717d (patch) | |
tree | 85aee90c851c260305a09c48ea5d16da59b64fa6 | |
parent | a45ca532576fa7241db6c83c018f4ef6378633b1 (diff) | |
download | chromium_src-ccaddf9653bd5ddb1ae1426cfa61572385ed717d.zip chromium_src-ccaddf9653bd5ddb1ae1426cfa61572385ed717d.tar.gz chromium_src-ccaddf9653bd5ddb1ae1426cfa61572385ed717d.tar.bz2 |
Fix a valgrind error related to Zygote's CommandLine usage.
Also touch up some include guards and a comment.
Review URL: http://codereview.chromium.org/131054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18801 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 9 | ||||
-rw-r--r-- | chrome/common/main_function_params.h | 6 | ||||
-rw-r--r-- | chrome/renderer/renderer_main.cc | 2 |
3 files changed, 12 insertions, 5 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index c22d05c..0703fc3 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -488,8 +488,15 @@ int ChromeMain(int argc, const char** argv) { #endif } else if (process_type == switches::kZygoteProcess) { #if defined(OS_LINUX) - if (ZygoteMain(main_params)) + if (ZygoteMain(main_params)) { + // Zygote::HandleForkRequest may have reallocated the command + // line so update it here with the new version. + const CommandLine& parsed_command_line = + *CommandLine::ForCurrentProcess(); + MainFunctionParams main_params(parsed_command_line, sandbox_wrapper, + &autorelease_pool); RendererMain(main_params); + } #else NOTIMPLEMENTED(); #endif diff --git a/chrome/common/main_function_params.h b/chrome/common/main_function_params.h index 1a240c5..b224892 100644 --- a/chrome/common/main_function_params.h +++ b/chrome/common/main_function_params.h @@ -6,8 +6,8 @@ // plugin) to shield the call sites from the differences between platforms // (e.g., POSIX doesn't need to pass any sandbox information). -#ifndef CHROME_COMMON_MAIN_FUNCTINON_PARAMS_H_ -#define CHROME_COMMON_MAIN_FUNCTINON_PARAMS_H_ +#ifndef CHROME_COMMON_MAIN_FUNCTION_PARAMS_H_ +#define CHROME_COMMON_MAIN_FUNCTION_PARAMS_H_ #include "base/command_line.h" #include "chrome/common/sandbox_init_wrapper.h" @@ -30,4 +30,4 @@ struct MainFunctionParams { Task* ui_task; }; -#endif // CHROME_COMMON_MAIN_FUNCTINON_PARAMS_H_ +#endif // CHROME_COMMON_MAIN_FUNCTION_PARAMS_H_ diff --git a/chrome/renderer/renderer_main.cc b/chrome/renderer/renderer_main.cc index fc4d291..03e731f 100644 --- a/chrome/renderer/renderer_main.cc +++ b/chrome/renderer/renderer_main.cc @@ -59,7 +59,7 @@ static void HandleRendererErrorTestParameters(const CommandLine& command_line) { } } -// mainline routine for running as the Rendererer process +// mainline routine for running as the Renderer process int RendererMain(const MainFunctionParams& parameters) { const CommandLine& parsed_command_line = parameters.command_line_; base::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; |