| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // TODO(port): the ifdefs in here are a first step towards trying to determine | 5 // TODO(port): the ifdefs in here are a first step towards trying to determine |
| 6 // the correct abstraction for all the OS functionality required at this | 6 // the correct abstraction for all the OS functionality required at this |
| 7 // stage of process initialization. It should not be taken as a final | 7 // stage of process initialization. It should not be taken as a final |
| 8 // abstraction. | 8 // abstraction. |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 // requirement for gconf. | 906 // requirement for gconf. |
| 907 g_type_init(); | 907 g_type_init(); |
| 908 // We use glib-dbus for geolocation and it's possible other libraries | 908 // We use glib-dbus for geolocation and it's possible other libraries |
| 909 // (e.g. gnome-keyring) will use it, so initialize its threading here | 909 // (e.g. gnome-keyring) will use it, so initialize its threading here |
| 910 // as well. | 910 // as well. |
| 911 dbus_g_thread_init(); | 911 dbus_g_thread_init(); |
| 912 // gtk_init() can change |argc| and |argv|. | 912 // gtk_init() can change |argc| and |argv|. |
| 913 gtk_init(&argc, &argv); | 913 gtk_init(&argc, &argv); |
| 914 SetUpGLibLogHandler(); | 914 SetUpGLibLogHandler(); |
| 915 | 915 |
| 916 x11_util::SetX11ErrorHandlers(); | 916 x11_util::SetDefaultX11ErrorHandlers(); |
| 917 #endif // defined(OS_LINUX) | 917 #endif // defined(OS_LINUX) |
| 918 | 918 |
| 919 rv = BrowserMain(main_params); | 919 rv = BrowserMain(main_params); |
| 920 } else { | 920 } else { |
| 921 NOTREACHED() << "Unknown process type"; | 921 NOTREACHED() << "Unknown process type"; |
| 922 } | 922 } |
| 923 | 923 |
| 924 if (SubprocessNeedsResourceBundle(process_type)) | 924 if (SubprocessNeedsResourceBundle(process_type)) |
| 925 ResourceBundle::CleanupSharedInstance(); | 925 ResourceBundle::CleanupSharedInstance(); |
| 926 | 926 |
| 927 #if defined(OS_WIN) | 927 #if defined(OS_WIN) |
| 928 #ifdef _CRTDBG_MAP_ALLOC | 928 #ifdef _CRTDBG_MAP_ALLOC |
| 929 _CrtDumpMemoryLeaks(); | 929 _CrtDumpMemoryLeaks(); |
| 930 #endif // _CRTDBG_MAP_ALLOC | 930 #endif // _CRTDBG_MAP_ALLOC |
| 931 | 931 |
| 932 _Module.Term(); | 932 _Module.Term(); |
| 933 #endif | 933 #endif |
| 934 | 934 |
| 935 logging::CleanupChromeLogging(); | 935 logging::CleanupChromeLogging(); |
| 936 | 936 |
| 937 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) | 937 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) |
| 938 // TODO(mark): See the TODO(mark) above at InitCrashReporter. | 938 // TODO(mark): See the TODO(mark) above at InitCrashReporter. |
| 939 DestructCrashReporter(); | 939 DestructCrashReporter(); |
| 940 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD | 940 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD |
| 941 | 941 |
| 942 return rv; | 942 return rv; |
| 943 } | 943 } |
| OLD | NEW |