diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 01:20:20 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 01:20:20 +0000 |
commit | c3515284acdfe396393537c1638443477714c608 (patch) | |
tree | c7d4e17756a6588219466110dae91e9bea5b42cd /chrome/app/chrome_dll_main.cc | |
parent | d16746287d5881d9f8f36bef0e5c7fdc9022e88e (diff) | |
download | chromium_src-c3515284acdfe396393537c1638443477714c608.zip chromium_src-c3515284acdfe396393537c1638443477714c608.tar.gz chromium_src-c3515284acdfe396393537c1638443477714c608.tar.bz2 |
Linux: don't call gtk_init in the renderer process.
Previously, our command line objects were created /after/ gtk_init had
processed |argc| and |argv|. With this patch, it's created before hand
and main's |argc| and |argv| are now kept pristine. Thus our command
line will now reflect GTK arguments that previously it wouldn't have
seen. This should be harmless.
Review URL: http://codereview.chromium.org/39172
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10950 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/chrome_dll_main.cc')
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index ef86970..6978e7b 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -245,14 +245,6 @@ int ChromeMain(int argc, const char** argv) { // its main event loop to get rid of the cruft. base::ScopedNSAutoreleasePool autorelease_pool; -#if defined(OS_LINUX) - // gtk_init() can change |argc| and |argv| and thus must be called before - // CommandLine::Init(). - // TODO(estade): we should make a copy of |argv| instead of const_casting - // it. - gtk_init(&argc, const_cast<char***>(&argv)); -#endif - // Initialize the command line. #if defined(OS_WIN) CommandLine::Init(0, NULL); @@ -378,6 +370,11 @@ int ChromeMain(int argc, const char** argv) { rv = WorkerMain(main_params); #endif } else if (process_type.empty()) { +#if defined(OS_LINUX) + // gtk_init() can change |argc| and |argv|, but nobody else uses them. + gtk_init(&argc, const_cast<char***>(&argv)); +#endif + ScopedOleInitializer ole_initializer; rv = BrowserMain(main_params); } else { |