From c3515284acdfe396393537c1638443477714c608 Mon Sep 17 00:00:00 2001 From: "agl@chromium.org" Date: Thu, 5 Mar 2009 01:20:20 +0000 Subject: 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 --- chrome/app/chrome_dll_main.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'chrome/app') 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(&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(&argv)); +#endif + ScopedOleInitializer ole_initializer; rv = BrowserMain(main_params); } else { -- cgit v1.1